@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
.upload-choices {display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.original-preview {margin-bottom:18px}
.original-preview summary {cursor:pointer;font-size:12px;color:#42663e}
.original-preview img {display:block;max-width:100%;max-height:420px;object-fit:contain;margin:14px auto;border-radius:10px;border:1px solid #e3e8dd}
.original-preview a {display:block;margin-top:10px}
.draft-readiness{padding:10px 13px;margin:0 0 15px;border-radius:8px;background:#edf3e5;color:#416239;font-size:12px;font-weight:600;line-height:1.6;overflow-wrap:anywhere}
.scan-preview{position:relative;overflow:hidden;isolation:isolate;background:#e9eee4;border-radius:12px;border:1px solid #dce5d4;max-width:100%;max-height:420px;display:flex;justify-content:center;align-items:center}
.scan-preview img{margin:0;border:0;border-radius:0;max-width:100%;max-height:420px;object-fit:contain}
.scan-preview.is-scanning img{animation:receipt-focus 5s ease-in-out infinite}
.scan-band{position:absolute;left:0;right:0;height:22%;bottom:-23%;pointer-events:none;background:linear-gradient(to top,transparent,rgba(161,217,105,.13),rgba(128,197,71,.45));border-top:2px solid #96cc62;box-shadow:0 -4px 20px #91c86250;animation:receipt-scan 2.8s linear infinite}
.pdf-preview{padding:25px;text-align:center;background:#eef3e8;border-radius:12px;display:grid;gap:9px;color:#3e6036}
.pdf-preview>span{font-size:34px}.pdf-preview small{font-size:11px}
.draft-status{overflow-wrap:anywhere;line-height:1.65}
@keyframes receipt-scan{from{bottom:-23%}to{bottom:103%}}
@keyframes receipt-focus{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}
@media(prefers-reduced-motion:reduce){.scan-preview.is-scanning img,.scan-band{animation:none}.scan-band{bottom:45%;height:2px;background:#96cc62}}
@media(max-width:760px){.scan-preview,.scan-preview img{max-height:320px}.draft-readiness{font-size:11px}}
.sidebar nav button {min-width:0}
.sidebar nav button span {overflow-wrap:anywhere}
@media(max-width:760px){.sidebar nav button span{font-size:8px}.upload-choices button{width:100%}.original-preview img{max-height:330px}.draft-head>div{min-width:0}}
:root {
  --ink: #183b30;
  --muted: #758178;
  --green: #255a43;
  --lime: #d7ed9e;
  --bg: #f7f8f3;
  --border: #e3e8dd;
  --white: #fff;
  --orange: #99651d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #283e34;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #9ecf75;
  outline-offset: 3px;
}
button {
  border: 0;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
.brand {
  font-family: Manrope, system-ui, sans-serif;
}
h1 {
  font-size: 38px;
  letter-spacing: -1.8px;
  line-height: 1.2;
  margin: 12px 0;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.65px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 0;
}
p {
  line-height: 1.6;
}
small {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 254px;
  background: #173c30;
  position: fixed;
  inset: 0 auto 0 0;
  color: #e6efdf;
  padding: 38px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.8px;
}
.brand-icon {
  background: var(--lime);
  color: #23442e;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 28px;
  font-weight: 800;
}
.brand small {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  letter-spacing: 1.65px;
  color: #a6b7a7;
  margin-top: 5px;
}
.sidebar-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #9fb3a5;
  margin: 50px 14px 18px;
}
.sidebar nav {
  display: grid;
  gap: 9px;
}
.sidebar nav button {
  background: transparent;
  color: #b8c9bd;
  text-align: left;
  border-radius: 11px;
  padding: 14px 13px;
  font-size: 19px;
  display: flex;
  gap: 13px;
  align-items: center;
}
.sidebar nav button span {
  font-size: 13px;
  font-weight: 500;
}
.sidebar nav button.active {
  background: #d8edab;
  color: #24442d;
}
.sidebar nav button:hover:not(.active) {
  background: #254a3b;
  color: white;
}
.sidebar-foot {
  margin-top: auto;
  padding: 24px 12px 0;
  border-top: 1px solid #355344;
  font-size: 12px;
}
.sidebar-foot small {
  display: block;
  margin: 10px 0 23px;
  color: #9fb3a5;
  font-size: 10px;
}
.local-dot {
  display: inline-block;
  background: #c7e692;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  margin-right: 7px;
}
.text-button {
  padding: 7px 0;
  background: none;
  color: inherit;
  display: block;
  font-size: 12px;
}
main {
  margin-left: 254px;
}
.topbar {
  padding: 26px 42px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background: #ffffff99;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #6c7c68;
}
.top-note {
  display: block;
  font-size: 11px;
  color: #849080;
  margin-top: 6px;
}
.period-tools {
  display: flex;
  gap: 7px;
  align-items: center;
}
select,
input,
textarea {
  width: 100%;
  background: white;
  color: var(--ink);
  border: 1px solid #dce3d7;
  border-radius: 9px;
  padding: 12px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #6f9565;
  box-shadow: 0 0 0 3px #dcebc8;
}
select {
  cursor: pointer;
}
textarea {
  resize: vertical;
  min-height: 86px;
}
.period-tools select {
  min-width: 190px;
  font-size: 12px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #ebefe5;
  color: #34593d;
  flex-shrink: 0;
}
.page {
  max-width: 1450px;
  margin: 0 auto;
  padding: 35px 42px 50px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.intro p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 6px;
  background: #e8efdd;
  color: #557240;
  white-space: nowrap;
}
.primary,
.secondary,
.danger {
  padding: 13px 19px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.primary {
  background: var(--green);
  color: white;
}
.primary:hover {
  background: #184532;
}
.secondary {
  background: white;
  border: 1px solid #dce3d7;
  color: var(--ink);
}
.danger {
  background: #f9e7e2;
  color: #a63c30;
}
.hero {
  background: #e9efdc;
  border: 1px solid #dfe8cf;
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero h2 {
  font-size: 25px;
  max-width: 310px;
  margin-top: 15px;
  line-height: 1.25;
}
.hero p {
  font-size: 12px;
  max-width: 330px;
  color: #698062;
}
.dropzone {
  border: 1.5px dashed #a9bc93;
  border-radius: 13px;
  background: #f9fcf2b3;
  text-align: center;
  padding: 24px 18px;
  transition: 0.2s;
  cursor: pointer;
}
.dropzone.drag {
  background: #d3e7b4;
  border-color: var(--green);
}
.upload-icon {
  display: block;
  width: 46px;
  height: 46px;
  line-height: 46px;
  font-size: 27px;
  background: white;
  border-radius: 13px;
  margin: 0 auto 13px;
  color: #52743b;
}
.dropzone h3 {
  font-size: 14px;
  margin: 8px 0;
}
.dropzone p {
  font-size: 11px;
  margin: 8px auto 14px;
}
.dropzone small {
  display: block;
  font-size: 10px;
  margin-top: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin: 24px 0;
}
.stat {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  padding: 23px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.stat strong {
  display: block;
  font-size: 28px;
  font-family: Manrope, sans-serif;
  letter-spacing: -1px;
  margin: 13px 0 9px;
  font-weight: 800;
}
.stat small {
  font-size: 10px;
}
.stat.accent {
  background: #173c30;
  color: #edf4e5;
  border-color: #173c30;
}
.stat.accent .stat-label,
.stat.accent small {
  color: #bed0bc;
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 22px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  padding: 24px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.card-head h2 {
  font-size: 16px;
  margin: 0;
}
.card-head small {
  font-size: 10px;
}
.plain-link {
  background: none;
  color: #4e723c;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
}
.entry {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid #eef1e8;
}
.entry:last-child {
  border: 0;
}
.entry-icon {
  width: 37px;
  height: 42px;
  background: #f0f3e8;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.entry-info {
  flex: 1;
  min-width: 0;
}
.entry-info strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.entry-info small {
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
.entry-amount {
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 700;
}
.entry-amount small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  margin-top: 6px;
}
.category-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 17px 0;
  font-size: 11px;
}
.category-bar {
  height: 4px;
  border-radius: 9px;
  background: #ecf0e5;
  margin-top: -8px;
}
.category-bar span {
  height: 4px;
  background: #719450;
  display: block;
  border-radius: 9px;
}
.note {
  padding: 13px 15px;
  border-radius: 9px;
  background: #f3f5ee;
  font-size: 11px;
  line-height: 1.6;
  color: #6d7c63;
}
.warning {
  background: #fff5e2;
  color: #8b662c;
}
.section-title {
  margin: 28px 0 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #61715f;
}
label input,
label select,
label textarea {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 400;
}
label small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
}
.span-all {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.draft {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  padding: 21px;
  margin: 16px 0;
}
.draft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.draft-head strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.draft-head small {
  display: block;
  margin-top: 6px;
}
.draft .form-grid {
  grid-template-columns: repeat(3, 1fr);
}
.draft.error {
  border-color: #db997c;
}
.draft details {
  margin-top: 16px;
}
.draft summary {
  font-size: 11px;
  color: #6e805f;
  cursor: pointer;
}
.draft details .form-grid {
  margin-top: 15px;
}
.draft-status {
  font-size: 11px;
  color: #7b835f;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar input {
  max-width: 430px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
  color: #8a9484;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 18px 10px;
  border-bottom: 1px solid #edf0e8;
  vertical-align: top;
}
td small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 5px;
}
.nowrap {
  white-space: nowrap;
}
.table-actions {
  display: flex;
  gap: 6px;
}
.empty {
  text-align: center;
  padding: 38px 15px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}
.export-text {
  width: 100%;
  min-height: 490px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.8;
  background: #fbfcf8;
}
.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 20px;
}
.mini-step {
  display: flex;
  gap: 12px;
  margin: 23px 0;
  font-size: 12px;
  line-height: 1.6;
}
.step-num {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #eaf1dc;
  text-align: center;
  line-height: 27px;
  flex-shrink: 0;
  color: #57713b;
  font-size: 10px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.chip {
  background: #f0f4e8;
  border: 1px solid #e4ebd9;
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 11px;
  margin: 7px 0;
  overflow-wrap: anywhere;
}
.catalog-form {
  display: flex;
  gap: 7px;
  margin-top: 20px;
}
.catalog-form input {
  min-width: 0;
}
.catalog-form button {
  padding: 10px;
}
footer {
  padding: 15px 42px 25px;
  font-size: 10px;
  color: #9aa391;
}
footer span {
  padding: 0 8px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(650px, 94vw);
  padding: 26px;
  color: var(--ink);
  max-height: 90vh;
  box-shadow: 0 25px 120px #183b3030;
}
dialog::backdrop {
  background: #102b2466;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-head h2 {
  margin: 0;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top right, #e0ebce, transparent 65%), var(--bg);
}
.auth-card {
  width: min(430px, 90vw);
  padding: 42px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 25px 90px #173c3008;
}
.auth-card > .brand-icon {
  margin-bottom: 25px;
}
.auth-card .eyebrow {
  display: block;
}
.auth-card h1 {
  font-size: 36px;
}
.auth-card h1 span {
  color: #92af60;
}
.auth-card p {
  color: var(--muted);
  font-size: 13px;
}
.auth-card label {
  margin-top: 18px;
}
.auth-card form button {
  margin-top: 22px;
  width: 100%;
}
.auth-card > small {
  display: block;
  font-size: 10px;
  margin-top: 24px;
  text-align: center;
}
#auth-error {
  color: #b34937;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #153e2f;
  color: white;
  padding: 15px 22px;
  border-radius: 11px;
  box-shadow: 0 10px 50px #173c3030;
  z-index: 20;
  max-width: 90vw;
  font-size: 12px;
}
.png-preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 12px 0;
}
.batch-total {
  font-size: 15px;
  font-weight: 700;
  margin-left: auto;
}
.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
}
/* Allow grid/flex children to shrink instead of widening the viewport. */
html, body { max-width: 100%; overflow-x: clip; }
main, .page, .card, .hero > *, .form-grid > *, .stats > *,
.export-layout > *, .catalog-grid > *, .topbar > * { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
.eyebrow, .entry-info small, .category-row, .note { overflow-wrap: anywhere; }
@media (min-width: 1550px) {
  .page {
    padding-top: 50px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 218px;
    padding: 32px 17px;
  }
  main {
    margin-left: 218px;
  }
  .page {
    padding: 30px 25px;
  }
  .topbar {
    padding: 22px 25px;
  }
  .brand {
    font-size: 18px;
  }
  .grid-main,
  .export-layout {
    grid-template-columns: 1fr;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .stat strong {
    font-size: 23px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: 68px;
    padding: 5px 6px;
    z-index: 10;
    background: #173c30;
  }
  .sidebar > .brand,
  .sidebar-label,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    display: flex;
    justify-content: space-around;
    gap: 0;
  }
  .sidebar nav button {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 6px 2px;
    border-radius: 8px;
    font-size: 19px;
  }
  .sidebar nav button span {
    font-size: 8px;
  }
  .sidebar nav button.active {
    background: #2b503e;
    color: #e0efb2;
  }
  main {
    margin: 0;
    padding-bottom: 70px;
  }
  .topbar {
    padding: 18px;
    gap: 10px;
  }
  .top-note {
    display: none;
  }
  .topbar .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .period-tools {
    gap: 4px;
  }
  .period-tools select {
    min-width: 0;
    width: 145px;
    padding: 9px;
    font-size: 10px;
  }
  .icon-button {
    width: 31px;
    height: 31px;
  }
  .page {
    padding: 24px 17px;
  }
  .intro {
    align-items: flex-start;
  }
  .intro h1 {
    font-size: 29px;
  }
  .intro p {
    font-size: 11px;
  }
  .intro > .badge {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 14px;
  }
  .hero h2 {
    font-size: 23px;
    max-width: none;
  }
  .hero p {
    max-width: none;
  }
  .hero .dropzone {
    padding: 18px;
  }
  .stats {
    gap: 8px;
    margin: 18px 0;
  }
  .stat {
    padding: 14px 10px;
  }
  .stat-label {
    font-size: 9px;
  }
  .stat-label span {
    display: none;
  }
  .stat strong {
    font-size: 17px;
    letter-spacing: -0.5px;
  }
  .stat small {
    font-size: 8px;
  }
  .card {
    padding: 18px;
  }
  .form-grid,
  .draft .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .draft {
    padding: 16px;
  }
  .draft-head strong {
    font-size: 11px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar input {
    max-width: none;
  }
  .toolbar .primary {
    width: 100%;
  }
  .batch-total {
    width: 100%;
    margin: 0;
  }
  .entry-info strong {
    font-size: 11px;
  }
  .entry-amount {
    font-size: 12px;
  }
  .auth-card {
    padding: 30px;
  }
  .export-text {
    font-size: 10px;
  }
  footer {
    padding: 15px 20px;
  }
  .period-tools > .icon-button {
    width: 27px;
  }
  .actions .primary {
    flex: 1;
  }
  .topbar { flex-wrap: wrap; }
  .period-tools { flex: 1 1 100%; width: 100%; }
  .period-tools select { flex: 1; width: 0; font-size: 16px; }
  input, select, textarea, label input, label select, label textarea,
  .export-text { font-size: 16px; }
  .form-grid, .draft .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 18px; }
  .stat strong { font-size: 26px; overflow-wrap: anywhere; }
  .stat-label { font-size: 12px; }
  .stat small { font-size: 11px; }
  .card-head, .draft-head { flex-wrap: wrap; }
  .primary, .secondary, .danger, .icon-button { min-height: 44px; }
  .period-tools > .icon-button { width: 44px; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
  td { border: 0; padding: 8px 0; white-space: normal !important; overflow-wrap: anywhere; }
  td::before { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
  td:nth-child(1)::before { content: 'DATA / HORÁRIO'; }
  td:nth-child(2)::before { content: 'RESPONSÁVEL E DESTINO'; }
  td:nth-child(3)::before { content: 'CATEGORIA'; }
  td:nth-child(4)::before { content: 'VALOR'; }
  td:nth-child(5)::before { content: 'COMPROVANTE'; }
  td[colspan]::before { content: none; }
  .table-actions { justify-content: flex-end; }
  .table-actions .icon-button { width: 44px; }
  dialog { padding: 18px; max-height: 90dvh; }
  .sidebar { height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
