@font-face {
  font-family: "DM Sans";
  src: url("/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: #142439;
  background: #f4f7fa;
  --ink: #142439;
  --muted: #4f6278;
  --brand: #145b8e;
  --brand-contrast: #104d7a;
  --line: #dce4eb;
  --navy: #12233b;
  --white: #fff;
  --shadow: 0 13px 36px rgba(24, 51, 78, .09);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #3d90c1; outline-offset: 2px;
}
button:disabled { cursor: wait; opacity: .72; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.045em; font-weight: 760; line-height: 1.15; }
h2 { font-size: 1.18rem; letter-spacing: -.026em; line-height: 1.23; }
h3 { font-size: .97rem; }
label { font-weight: 660; }
small { font-size: .82rem; }
.skip-link { position: fixed; top: 8px; left: 8px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; z-index: 20; }
.skip-link:focus { width: auto; height: auto; overflow: visible; clip-path: none; background: #fff; padding: 12px; }
.standalone-message { padding: 2rem; color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; width: fit-content; }
.brand strong { display: block; line-height: 1.12; font-size: 1.05rem; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; font-size: .73rem; }
.brand-inverse { color: #f1f6fb; }
.brand-inverse small { color: #b5cae0; }
.brand-symbol { display: grid; align-content: center; gap: 3px; width: 39px; height: 39px; border-radius: 10px; background: #d0eeff; padding: 9px; }
.brand-symbol i { display: block; height: 3px; width: 100%; border-radius: 2px; background: #1a537e; }
.brand-symbol i:last-child { width: 68%; }
.environment { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 11px; border-radius: 999px; background: #fef0d1; color: #644408; font-size: .8rem; font-weight: 760; white-space: nowrap; }
.environment i { width: 7px; height: 7px; border-radius: 50%; background: #a16910; }

.login-view { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); }
.login-identity { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 70px; padding: 42px clamp(35px, 7vw, 114px) 86px; background: linear-gradient(150deg, #12233a 15%, #1a4668 100%); color: #fff; overflow: hidden; }
.login-intro { max-width: 550px; margin-block: auto; }
.login-intro h1 { font-size: clamp(2.55rem, 5vw, 5rem); line-height: 1.03; }
.login-intro p { margin-top: 22px; font-size: clamp(1rem, 1.6vw, 1.22rem); color: #d1e3f1; line-height: 1.58; max-width: 420px; }
.login-paper { position: absolute; right: -71px; bottom: -99px; width: 306px; height: 330px; border: 1px solid #fff3; border-radius: 22px; transform: rotate(-22deg); z-index: -1; padding: 43px 30px; opacity: .56; }
.login-paper i { display: block; height: 12px; background: #89c9ed4d; width: 64%; margin-bottom: 22px; border-radius: 9px; }
.login-paper i:nth-child(2n) { width: 41%; }
.login-form-wrap { display: grid; place-items: center; padding: 44px 30px; background: #f4f7fa; }
.login-form { width: min(100%, 400px); padding: clamp(26px, 4vw, 38px); background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.login-form h2 { margin: 14px 0 26px; font-size: 1.65rem; }
.login-form label { display: block; margin: 14px 0 5px; }
.login-form .button { margin-top: 23px; width: 100%; justify-content: space-between; }

.application { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; align-items: stretch; background: var(--navy); color: #d8e5f3; padding: 26px 15px 16px; overflow: auto; }
.sidebar .brand { margin: 0 8px; }
.sidebar nav { display: grid; gap: 5px; margin-top: 35px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 8px 11px; border-radius: 9px; color: #c8d8e9; font-size: .89rem; font-weight: 660; text-decoration: none; }
.sidebar nav a:hover { background: #ffffff13; color: #fff; }
.sidebar nav a[aria-current] { color: #fff; background: #265479; }
.nav-icon { display: inline-grid; place-items: center; width: 22px; color: #bde8ff; font-size: 1.17rem; }
.nav-label-short { display: none; }
.sidebar-footer { display: grid; gap: 4px; margin: auto 3px 0; padding: 16px 7px 0; border-top: 1px solid #ffffff25; color: #c8d8e9; }
#session-email, #mobile-email { overflow-wrap: anywhere; font-size: .8rem; }
.logout { min-height: 40px; padding: 4px 8px; margin-left: -8px; background: transparent; border: 0; color: inherit; font-weight: 720; justify-self: start; }
.logout:hover { text-decoration: underline; }
.workspace { min-width: 0; }
.topbar { min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px clamp(16px, 4vw, 47px); border-bottom: 1px solid var(--line); background: #fff; }
.organization-field { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: min(70%, 460px); }
.organization-field label { color: var(--muted); font-size: .83rem; }
.organization-field select { min-width: 0; color: var(--ink); background-color: #f5f8fb; border: 1px solid #e0e8ef; font-size: .9rem; font-weight: 725; min-height: 40px; padding-block: 6px; }
#main { margin-inline: auto; padding: 35px clamp(16px, 4vw, 47px) 45px; max-width: 1550px; min-height: calc(100svh - 68px); }
.mobile-account { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head p, .lead { color: var(--muted); line-height: 1.5; }
.page-head p { margin-top: 6px; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 14px; border: 1px solid #d4e1ec; border-radius: 8px; color: #19466a; background: #fff; font-weight: 720; font-size: .88rem; text-decoration: none; line-height: 1.2; }
.button:hover { background: #edf6fb; border-color: #96b7d1; }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button.primary:hover { background: var(--brand-contrast); border-color: var(--brand-contrast); }
.button.danger { color: #951d2d; border-color: #e5bcc4; }
.button.danger:hover { background: #fff2f3; }
.button.compact { min-height: 37px; padding: 5px 10px; font-size: .82rem; }
.button span[aria-hidden] { font-size: 1.22em; line-height: 1; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 23px; }
.metric { min-width: 0; padding: 15px 16px; background: #fff; border-radius: 11px; border: 1px solid var(--line); }
.metric small { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 680; }
.metric strong { display: block; margin-top: 5px; font-size: 1.62rem; letter-spacing: -.04em; }
.metric i, .status i { width: 8px; height: 8px; background: currentColor; border-radius: 50%; flex: none; }
.tone-blue { color: #1d5f92; }
.tone-green { color: #1d735e; }
.tone-orange { color: #925d0b; }
.tone-red { color: #a23646; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 16px #2839540a; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; }
.panel-head span, .muted { color: var(--muted); }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 0 18px 15px; }
.filters label { flex: 0 1 170px; min-width: 130px; font-size: .8rem; color: var(--muted); }
.filters .search { flex: 1 1 220px; max-width: 310px; }
.filters input, .filters select { margin-top: 4px; min-height: 39px; font-size: .88rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead { background: #f3f7fa; color: #4d6276; }
th { font-size: .77rem; font-weight: 765; white-space: nowrap; }
th, td { padding: 11px 13px; border-top: 1px solid #e4ebf0; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 18px; }
td { color: #243852; font-size: .88rem; }
td strong, td small { display: block; }
td small { margin-top: 2px; color: var(--muted); }
td .button { white-space: nowrap; }
td.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.select-cell { width: 35px; padding-right: 4px; }
tr:hover td { background: #f9fbfd; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; font-weight: 730; font-size: .76rem; background: #edf3f9; color: #35516b; white-space: nowrap; }
.status i { width: 6px; height: 6px; }
.status.good { background: #e2f4ed; color: #145d4b; }
.status.wait { background: #fff0d5; color: #704601; }
.status.error { background: #fae8ec; color: #8e2636; }
.status.active { background: #e5f0fa; color: #1f5d88; }
.status.neutral { background: #edf1f4; color: #526072; }
.empty { padding: 30px 18px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.5; }
.empty strong { display: block; color: var(--ink); margin-bottom: 3px; }
.batch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: #edf5fb; color: #163a59; font-size: .88rem; }

dialog { width: min(680px, calc(100vw - 32px)); max-height: min(88svh, 860px); border: 1px solid #d7e2eb; padding: 0; border-radius: 15px; color: var(--ink); box-shadow: 0 25px 70px #091b4060; }
dialog::backdrop { background: #0e213b95; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 13px 18px; }
.dialog-head h2 { font-size: 1.22rem; }
.close { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #dce5ee; border-radius: 8px; background: #f5f8fb; color: #294660; font-size: 1.62rem; line-height: 1; }
.close:hover { background: #e9f3fb; }
.dialog-body { padding: 19px 18px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { min-width: 0; display: grid; align-content: start; gap: 5px; font-size: .87rem; }
.wide { grid-column: 1 / -1; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #c9d5e0; border-radius: 8px; background: #fff; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #62768b; }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { accent-color: var(--brand); width: 18px; height: 18px; cursor: pointer; margin: 0; vertical-align: middle; }
.check { display: flex; align-items: center; gap: 7px; min-height: 42px; font-size: .87rem; }
.form-error { margin-top: 8px; color: #8e2636; background: #fceef0; padding: 9px 12px; border-radius: 7px; font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 17px; border-top: 1px solid var(--line); }
.item-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 110px) auto; align-items: end; gap: 8px; margin-top: 8px; }
.remove-item { width: 42px; padding-inline: 0; }
.draft-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail-summary > div { padding: 9px 11px; border-radius: 8px; background: #f3f7fb; }
.detail-summary small { display: block; color: var(--muted); margin-bottom: 3px; }
.detail-summary strong { overflow-wrap: anywhere; }
.details { margin: 15px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.details > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; }
.details dt { color: var(--muted); font-size: .77rem; font-weight: 730; }
.details dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: .9rem; }
.callout { background: #eef5fb; border: 1px solid #d8e8f4; border-radius: 8px; padding: 10px 12px; margin: 12px 0; color: #244a69; font-size: .87rem; }
.callout.error { color: #8a2635; background: #fceff1; border-color: #f2d5dc; }
.events { display: grid; gap: 9px; list-style: none; margin: 8px 0 15px; padding: 0; }
.events li { display: grid; gap: 2px; padding-left: 10px; border-left: 2px solid #91bcdb; font-size: .87rem; }
.notice { position: fixed; bottom: 16px; right: 16px; max-width: min(470px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #d0e4f0; border-radius: 10px; background: #fff; color: #163951; box-shadow: var(--shadow); z-index: 5; }
.document-choice { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.document-choice label { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid #cfdde7; border-radius: 8px; font-size: .89rem; cursor: pointer; }
.document-choice label:has(input:checked) { background: #e7f2fa; border-color: #76aac9; }
.document-choice input { accent-color: var(--brand); }

@media (max-width: 1050px) {
  .application { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .topbar, #main { padding-inline: 20px; }
}
@media (max-width: 830px) {
  .application { display: flex; flex-direction: column; }
  .sidebar { position: relative; height: auto; padding: 12px 15px 0; gap: 8px; overflow: visible; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { display: flex; gap: 4px; margin: 0 -15px; padding: 0 15px 8px; overflow: auto; scrollbar-width: thin; }
  .sidebar nav a { flex: none; min-height: 40px; gap: 6px; padding: 6px 8px; font-size: .8rem; }
  .nav-icon { font-size: .98rem; width: 17px; }
  .sidebar-footer { display: none; }
  .mobile-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-inline: 20px; padding: 5px 0; color: var(--muted); }
  #main { min-height: 58svh; padding-top: 25px; }
}
@media (max-width: 650px) {
  .login-view { display: flex; flex-direction: column; }
  .login-identity { min-height: 250px; gap: 32px; padding: 22px 21px 33px; }
  .login-intro h1 { font-size: clamp(2rem, 7vw, 2.85rem); max-width: 360px; }
  .login-intro p { margin-top: 11px; }
  .login-form-wrap { padding: 22px 15px 36px; }
  .login-form { width: 100%; max-width: 410px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 2px 0 8px; overflow: visible; }
  .sidebar nav a { min-width: 0; padding: 5px; gap: 5px; }
  .sidebar .nav-icon { width: 14px; flex: none; }
  .nav-label-wide { display: none; }
  .nav-label-short { display: inline; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
  .page-head .primary { order: -1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 16px; }
  .metric { padding: 10px; }
  .metric small { gap: 5px; font-size: .75rem; }
  .metric strong { font-size: 1.37rem; }
  .topbar, #main { padding-inline: 14px; }
  .topbar { min-height: 57px; }
  .organization-field { gap: 5px; }
  .organization-field label { display: none; }
  .panel-head { padding-inline: 12px; }
  .filters { padding-inline: 12px; }
  .filters label { flex: 1; min-width: 111px; }
  .filters .search { flex-basis: 100%; max-width: none; }
  table.mobile-table, .mobile-table tbody { display: block; width: 100%; }
  .mobile-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .mobile-table tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 10px; border-top: 1px solid var(--line); padding: 11px 12px; }
  .mobile-table td, .mobile-table td:first-child { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  .mobile-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 710; margin-bottom: 2px; }
  .mobile-table td.primary-cell { grid-column: 1 / -1; }
  .mobile-table td.select-cell { justify-self: end; width: auto; grid-row: 1; grid-column: 2; display: block; }
  .mobile-table td.select-cell input { width: 24px; height: 24px; }
  .mobile-table td.select-cell + td.primary-cell { grid-row: 1; grid-column: 1; }
  .mobile-table td.table-action { grid-column: 1 / -1; }
  .mobile-table td.table-action .button { min-height: 41px; width: 100%; }
  .batch { padding: 9px 12px; }
  .detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
  .sidebar nav a { font-size: .75rem; }
  .button { min-height: 40px; font-size: .82rem; padding-inline: 9px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .item-fields { grid-template-columns: minmax(0, 1fr) 62px auto; gap: 5px; }
  .remove-item { width: 33px; }
  .document-choice { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.form-extra { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.form-extra summary { cursor: pointer; color: var(--brand-contrast); font-size: .88rem; font-weight: 700; }
.form-extra .form-grid { margin-top: 10px; }
.events li { overflow-wrap: anywhere; }

.fiscal-stack { display: grid; gap: 15px; max-width: 1120px; }
.fiscal-panel { min-width: 0; padding: 18px; }
.fiscal-scope { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.fiscal-scope .field { max-width: 520px; }
.fiscal-scope-cnpj { min-width: 0; margin-top: 6px; display: none; font-size: .8rem; overflow-wrap: anywhere; }
.fiscal-scope select { text-overflow: ellipsis; }
.fiscal-panel-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.fiscal-panel-head .muted { margin-top: 4px; line-height: 1.45; font-size: .87rem; }
.fiscal-models > h2 { margin: 2px 0 9px; }
.fiscal-model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fiscal-model-grid article { display: flex; flex-direction: column; }
.fiscal-model-grid h3 { font-size: 1.12rem; }
.fiscal-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 14px 0 0; }
.fiscal-facts > div { min-width: 65px; }
.fiscal-facts dt { color: var(--muted); font-size: .76rem; font-weight: 680; }
.fiscal-facts dd { color: var(--ink); margin: 2px 0 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.fiscal-panel .callout, .fiscal-message { margin: 12px 0 0; overflow-wrap: anywhere; }
.fiscal-message { margin-top: 0; }
.fiscal-reason { margin-top: 11px; font-size: .85rem; }
.fiscal-actions { margin-top: 14px; }
.fiscal-model-grid .fiscal-actions { margin-top: auto; padding-top: 14px; }
input[type="file"]::file-selector-button { background: #edf5fb; border: 1px solid #d4e1ec; border-radius: 5px; color: #19466a; font: inherit; margin-inline-end: 9px; padding: 4px 8px; }

@media (max-width: 730px) {
  .fiscal-scope, .fiscal-model-grid { grid-template-columns: minmax(0, 1fr); }
  .fiscal-scope-cnpj { display: block; }
  .fiscal-panel { padding: 14px; }
}
