:root {
  --nav: #101722;
  --nav-2: #172130;
  --brand: #002b5f;
  --accent: #d71920;
  --line: #d9dfe7;
  --muted: #5f6b7a;
  --text: #0d1b2a;
  --bg: #f5f7fa;
  --panel: #fff;
  --ok: #16a34a;
  --warn: #b45309;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 280px 1fr;
}

body.auth-pending .sidebar,
body.auth-pending .app {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #101722, #002b5f);
  display: none;
  place-items: center;
  padding: 22px;
  z-index: 20;
}
body.auth-pending .login-screen { display: grid; }
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 15px;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.login-brand {
  color: var(--text);
  margin-bottom: 6px;
}
.login-brand .brand-logo {
  background: var(--nav);
  border-radius: 6px;
  padding: 8px;
}
.login-brand .brand-mark {
  color: var(--brand);
  border-color: var(--brand);
}
.login-brand strong {
  display: none;
}
.login-brand span { color: var(--muted); }
.first-access-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  display: grid;
  gap: 10px;
}
.first-access-box[hidden] { display: none; }
.first-access-box strong {
  font-size: 16px;
}
.login-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.login-card > p.muted:last-child { display: none; }

.sidebar {
  background: var(--nav);
  color: #fff;
  min-height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 150px;
  height: auto;
  display: block;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
}
.brand strong { display: none; }
.brand span { color: #cbd5e1; font-size: 13px; }

nav { display: grid; gap: 8px; }
.nav-item {
  border: 1px solid transparent;
  color: #dbeafe;
  background: transparent;
  text-align: left;
  padding: 13px 14px;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
}
.nav-item.active,
.nav-item:hover {
  background: var(--nav-2);
  border-color: #344256;
}
.nav-icon {
  display: none;
}
.label-short {
  display: none;
}

.connection {
  margin-top: auto;
  border: 1px solid #344256;
  background: var(--nav-2);
  padding: 16px;
  border-radius: 6px;
}
.connection-dot {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #22c55e;
  margin-bottom: 10px;
}
.connection strong, .connection small { display: block; }
.connection small { margin-top: 7px; color: #cbd5e1; }
.account-menu-button {
  display: none;
}
.account-avatar {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: #fff;
}
.avatar-head {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  background: currentColor;
  border-radius: 999px;
}
.avatar-body {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 22px;
  height: 13px;
  transform: translateX(-50%);
  background: currentColor;
  border-radius: 999px 999px 5px 5px;
}
.account-first-name {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}
.connection-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.logout-button {
  width: 100%;
  background: transparent;
  border-color: #465568;
  color: #fff;
}
.logout-button:hover {
  background: #223044;
}
.password-link {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.password-link:hover {
  color: #fff;
  background: transparent;
}

.app { padding: 22px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 12px;
}
h1, h2 { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }

.toolbar { display: flex; gap: 8px; }
button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 4px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
button.ghost { background: #fff; }
button.small { padding: 7px 10px; font-size: 13px; }
button.danger { color: var(--bad); }
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}
.link-button:hover { color: var(--brand); text-decoration: underline; }
.financeiro-omie-check {
  width: 18px;
  height: 18px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status {
  padding: 12px 14px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985;
  margin-bottom: 16px;
}
.status.error { background: #fee2e2; color: #991b1b; }

.error-text {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .28);
}
.busy-overlay[hidden] { display: none; }
.busy-box {
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  display: grid;
  gap: 10px;
}
.busy-box strong { font-size: 18px; }
.busy-box span { color: var(--muted); }
.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}
.progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

.view { display: none; }
.view.active { display: block; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.metric { padding: 16px; }
.metric span, .metric small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  display: block;
  font-size: 28px;
  margin: 7px 0 4px;
}
.metric-action {
  cursor: pointer;
}
.metric-action:hover,
.metric-action:focus-visible {
  border-color: #b8c7db;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  outline: none;
}
.panel { padding: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.account-current-head {
  align-items: flex-start;
}
.account-current-tools {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(150px, auto) auto;
  align-items: end;
  gap: 10px;
}
.account-filter {
  min-width: 0;
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0;
}
.account-filter select {
  min-height: 42px;
  margin-top: 6px;
}
.balance-card {
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.balance-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.balance-card strong {
  font-size: 18px;
  white-space: nowrap;
}
.split {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 14px;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.form h2, .form .wide { grid-column: 1 / -1; }
label {
  display: grid;
  gap: 6px;
  color: #415063;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 11px;
  font: inherit;
  text-transform: none;
}
textarea { resize: vertical; }
.search { max-width: 330px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  color: #475569;
}
td strong { display: block; }
.money-detail {
  min-width: 180px;
}
.money-detail small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.money-detail.result strong {
  color: var(--brand);
}
.muted { color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  font-size: 12px;
}
.pill.rascunho { background: #e2e8f0; }
.pill.em_aprovacao { background: #fef3c7; color: #92400e; }
.pill.aprovado { background: #dcfce7; color: #166534; }
.pill.prestado { background: #e0f2fe; color: #075985; }
.pill.cancelado { background: #e5e7eb; color: #4b5563; }
.pill.reprovado { background: #fee2e2; color: #991b1b; }
.pill.enviada_superior { background: #dbeafe; color: #1d4ed8; }
.pill.em_validacao_financeira { background: #fef3c7; color: #92400e; }
.pill.finalizada { background: #dcfce7; color: #166534; }
.pill.a_pagar { background: #e0f2fe; color: #075985; }
.pill.a_devolver { background: #ffedd5; color: #9a3412; }
.pill.pago { background: #d1fae5; color: #065f46; }
.pill.omie_integrada { background: #eef2ff; color: #3730a3; }
.pill.reprovada_superior, .pill.reprovada_financeiro { background: #fee2e2; color: #991b1b; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 4px;
  padding: 8px 10px;
  font-weight: 700;
}

.advance-summary {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
  padding: 11px;
  font-weight: 800;
  line-height: 1.35;
}
.pending-balance {
  display: block;
  margin-top: 8px;
  color: #7c2d12;
}

dialog {
  width: min(1080px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .25);
  overflow: auto;
}
dialog::backdrop { background: rgba(15, 23, 42, .55); }
.expense-dialog {
  width: min(620px, calc(100vw - 36px));
}
.qr-actions {
  justify-content: stretch;
}
.qr-actions button {
  width: 100%;
}
.qr-scanner-dialog {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
}
.qr-scanner {
  position: relative;
  background: #020617;
  aspect-ratio: 3 / 4;
  max-height: 72vh;
  overflow: hidden;
}
.qr-scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#qrScannerReader {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#qrScannerReader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
#qrScannerReader > div {
  border: 0 !important;
}
#qrScannerReader__scan_region,
#qrScannerReader__dashboard_section_csr,
#qrScannerReader__dashboard_section_swaplink {
  display: none !important;
}
#qrScannerVideo {
  position: absolute;
  inset: 0;
}
.qr-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(72vw, 300px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 4px solid #fff;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, .42);
}
.qr-frame::before,
.qr-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255,255,255,.55);
}
.qr-scanner-actions {
  display: flex;
  gap: 8px;
  padding: 14px;
  background: #fff;
}
.qr-scanner-actions button {
  flex: 1;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
#prestacaoDetail { padding: 18px; }
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.viewer-dialog {
  width: min(980px, calc(100vw - 32px));
}
.comprovantes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.comprovante-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.comprovante-viewer {
  height: min(78vh, 760px);
  display: grid;
  place-items: center;
  padding: 12px;
  background: #111827;
}
.comprovante-viewer img,
.comprovante-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.comprovante-viewer img {
  object-fit: contain;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}
.detail-cell {
  padding: 13px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.detail-cell:last-child { border-right: 0; }
.detail-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.detail-cell strong { display: block; margin-top: 6px; font-size: 18px; }
.detail-cell small {
  display: block;
  margin-top: 4px;
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .cards, .split { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  body {
    display: block;
    min-width: 0;
    background: #eef2f7;
    padding-bottom: 76px;
  }

  .login-screen {
    align-items: start;
    padding: 18px;
  }

  .login-card {
    margin-top: 12vh;
    border-radius: 10px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 0;
    padding: 12px;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    align-items: center;
    overflow: visible;
  }

  .brand {
    min-width: 0;
    overflow: hidden;
  }

  .brand > div:last-child {
    min-width: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .brand-logo {
    width: 132px;
  }

  .brand strong {
    display: none;
  }

  .brand span {
    display: block;
    max-width: 120px;
    font-size: 11px;
  }

  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 6px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, .12);
  }

  .nav-item {
    flex: 1 1 0;
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 46px;
    padding: 7px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
  }

  .nav-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    color: currentColor;
  }

  .label-full {
    display: none;
  }

  .label-short {
    display: inline;
  }

  .nav-home::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    width: 14px;
    height: 10px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 2px;
  }

  .nav-home::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .nav-money::before {
    content: "$";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 900;
  }

  .nav-doc::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 12px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 2px;
  }

  .nav-doc::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 8px;
    width: 7px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 5px 0 currentColor;
  }

  .nav-card::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 5px;
    width: 16px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 4px;
  }

  .nav-card::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    width: 10px;
    height: 2px;
    background: currentColor;
  }

  .nav-gear::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 14px;
    height: 14px;
    border: 3px solid currentColor;
    border-radius: 999px;
  }

  .nav-gear::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    width: 4px;
    height: 22px;
    background: currentColor;
    box-shadow: -7px 7px 0 -1px currentColor, 7px 7px 0 -1px currentColor;
    opacity: .65;
  }

  .nav-item.active {
    color: var(--brand);
    background: #eaf2ff;
    border: 0;
  }

  .connection {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 54px;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .connection > .connection-dot,
  .connection > strong,
  .connection > small {
    display: none !important;
  }

  .account-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
  }

  .account-avatar {
    display: block;
    width: 46px;
    height: 46px;
    border: 3px solid #fff;
    background: transparent;
  }

  .avatar-head {
    top: 8px;
    width: 12px;
    height: 12px;
  }

  .avatar-body {
    bottom: 7px;
    width: 22px;
    height: 14px;
    border-radius: 999px 999px 6px 6px;
  }

  .connection.open .account-menu-button {
    background: transparent;
  }

  .connection.open > .connection-dot,
  .connection.open small {
    display: none;
  }

  .connection-actions {
    display: none;
  }

  .connection.open .connection-actions {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid #344256;
    border-radius: 8px;
    background: var(--nav-2);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
  }

  .password-link {
    justify-self: stretch;
    padding: 7px 0;
    font-size: 12px;
    min-height: 0;
    text-align: left;
  }

  .logout-button {
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 7px 12px;
  }

  .app {
    padding: 14px 10px 28px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h1 {
    font-size: 25px;
    line-height: 1.12;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  button {
    min-height: 42px;
    padding: 9px 12px;
  }

  .cards {
    gap: 9px;
    margin-bottom: 10px;
  }

  .metric,
  .panel {
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  .metric {
    padding: 13px;
  }

  .metric strong {
    font-size: 24px;
  }

  .panel {
    padding: 12px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .account-current-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form h2,
  .form .wide {
    grid-column: auto;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    font-size: 16px;
  }

  textarea {
    min-height: 82px;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-bottom: 1px solid #edf1f5;
    text-align: right;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
  }

  td:not([data-label])::before {
    content: "";
  }

  #recentPrestacoes td:nth-child(1)::before,
  #prestacoesRows td:nth-child(1)::before,
  #adiantamentosRows td:nth-child(1)::before {
    content: "Número";
  }

  #recentPrestacoes td:nth-child(2)::before,
  #prestacoesRows td:nth-child(2)::before,
  #adiantamentosRows td:nth-child(2)::before {
    content: "Solicitante";
  }

  #recentPrestacoes td:nth-child(3)::before,
  #prestacoesRows td:nth-child(3)::before {
    content: "Período";
  }

  #adiantamentosRows td:nth-child(3)::before {
    content: "Data";
  }

  #recentPrestacoes td:nth-child(4)::before,
  #prestacoesRows td:nth-child(4)::before,
  #adiantamentosRows td:nth-child(6)::before {
    content: "Status";
  }

  #recentPrestacoes td:nth-child(5)::before,
  #prestacoesRows td:nth-child(5)::before,
  #adiantamentosRows td:nth-child(4)::before {
    content: "Despesas";
  }

  #recentPrestacoes td:nth-child(6)::before,
  #prestacoesRows td:nth-child(6)::before {
    content: "Adiantamentos";
  }

  #recentPrestacoes td:nth-child(7)::before,
  #prestacoesRows td:nth-child(7)::before {
    content: "Resultado";
  }

  #adiantamentosRows td:nth-child(5)::before {
    content: "Saldo";
  }

  #prestacoesRows td:nth-child(8)::before,
  #adiantamentosRows td:nth-child(7)::before {
    content: "Ação";
  }
  #financeiroRows td:nth-child(1)::before { content: "Integrar"; }
  #financeiroRows td:nth-child(2)::before { content: "Número"; }
  #financeiroRows td:nth-child(3)::before { content: "Solicitante"; }
  #financeiroRows td:nth-child(4)::before { content: "Despesas"; }
  #financeiroRows td:nth-child(5)::before { content: "Adiantamentos"; }
  #financeiroRows td:nth-child(6)::before { content: "Resultado"; }
  #financeiroRows td:nth-child(7)::before { content: "Pagamento"; }
  #financeiroRows td:nth-child(8)::before { content: "Situação"; }
  #financeiroRows td:nth-child(9)::before { content: "Ação"; }

  td strong,
  td small {
    text-align: right;
  }

  .row-actions {
    justify-content: flex-end;
  }

  .row-actions button {
    min-height: 34px;
    padding: 7px 9px;
  }

  dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 10px;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
    background: #fff;
  }

  #adiantamentoDialog,
  #devolucaoDialog,
  #despesaDialog,
  #prestacaoCreateDialog {
    max-height: calc(100dvh - 18px);
  }

  #adiantamentoDialog .form,
  #devolucaoDialog .form,
  #despesaDialog .form,
  #prestacaoCreateDialog .form {
    margin: 0;
    border: 0;
    border-radius: 0;
    max-height: none;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  #adiantamentoDialog input[type="date"],
  #devolucaoDialog input[type="date"],
  #despesaDialog input[type="date"],
  #prestacaoCreateDialog input[type="date"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    height: 46px;
    min-width: 0;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.2;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
  }

  #adiantamentoDialog button[type="submit"],
  #devolucaoDialog button[type="submit"],
  #despesaDialog button[type="submit"],
  #prestacaoCreateDialog button[type="submit"] {
    position: sticky;
    bottom: 0;
    z-index: 1;
    min-height: 48px;
  }

  #prestacaoDetail {
    padding: 12px;
  }

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

  .detail-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-cell:last-child {
    border-bottom: 0;
  }

  .viewer-dialog {
    width: calc(100vw - 16px);
  }

  .comprovante-viewer {
    height: 72vh;
  }
}
