:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --ink: #202938;
  --muted: #667085;
  --line: #e6e9ee;
  --nav: #17243a;
  --nav-strong: #22344f;
  --brand: #17243a;
  --brand-strong: #22344f;
  --brand-soft: #eef2fa;
  --accent: #b9945a;
  --ok: #16805d;
  --ok-bg: #eaf8f2;
  --warn: #a46208;
  --warn-bg: #fff6e5;
  --bad: #ad3434;
  --bad-bg: #fde3e3;
  --info: #2457c5;
  --info-bg: #edf3ff;
  --purple: #6941c6;
  --purple-bg: #f3effc;
  --shadow: 0 12px 35px rgba(23, 36, 58, 0.08);
  --app-font-family: Inter, Arial, Helvetica, sans-serif;
  --user-sidebar-open: 326px;
  --user-sidebar-closed: 76px;
  --user-sidebar-bg: #17243a;
  --user-sidebar-text: #eef4fb;
  --user-sidebar-muted: #aeb8c7;
  --user-sidebar-dim: #7f8da1;
  --user-sidebar-accent: #b9945a;
  --sidebar-open: 244px;
  --sidebar-closed: 76px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--app-font-family);
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(19, 117, 71, 0.12), transparent 36%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand,
.sidebar-brand,
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand {
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.login-brand strong,
.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.login-brand small,
.sidebar-brand small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.portal-return-link {
  display: inline-flex;
  width: fit-content;
  margin: -8px 0 16px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 650;
}

.portal-return-link:hover {
  text-decoration: underline;
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.role-switch button,
.side-nav button,
.side-nav a {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
  text-decoration: none;
}

.role-switch button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.login-form,
.process-form {
  display: grid;
  gap: 14px;
}

.login-link-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  padding: 0;
  font-size: 12px;
  font-weight: 750;
}

.login-link-button:hover {
  text-decoration: underline;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #98aacf;
  box-shadow: 0 0 0 3px #eef2fa;
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 13px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-strong);
}

.secondary-action {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-action:hover {
  border-color: #aebaca;
}

.ghost-action {
  width: 100%;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e7eb;
}

.danger-action {
  background: var(--bad-bg);
  color: var(--bad);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-open) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-closed,
.app-shell.sidebar-auto {
  grid-template-columns: var(--sidebar-closed) minmax(0, 1fr);
}

.app-shell.sidebar-auto.sidebar-hover {
  grid-template-columns: var(--sidebar-open) minmax(0, 1fr);
}

.app-shell.admin-layout {
  --sidebar-open: var(--user-sidebar-open);
  --sidebar-closed: var(--user-sidebar-closed);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--nav);
  color: #fff;
  padding: 26px 16px 18px;
  overflow: hidden;
  transition: padding 180ms ease;
}

.app-shell.sidebar-closed .sidebar,
.app-shell.sidebar-auto:not(.sidebar-hover) .sidebar {
  padding-left: 14px;
  padding-right: 14px;
}

.sidebar .brand-mark {
  background: transparent;
  border: 1px solid rgba(185, 148, 90, 0.7);
  color: #e3c38f;
}

.sidebar-head {
  position: relative;
  min-width: 224px;
  padding: 0 34px 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand {
  min-width: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.sidebar-brand-mark {
  flex: 0 0 42px;
  overflow: hidden;
}

.sidebar-brand-mark img {
  display: block;
  width: 33px;
  height: 33px;
  object-fit: contain;
}

.sidebar-pin-button {
  position: absolute;
  top: 4px;
  right: 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  opacity: 0.48;
  transition: background 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.sidebar-pin-button:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.78;
}

.sidebar-pin-button img {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto;
  object-fit: contain;
  filter: invert(1);
  transform: rotate(180deg);
  transition: transform 140ms ease;
}

.sidebar-pin-button[aria-pressed="true"] {
  opacity: 0.72;
}

.sidebar-pin-button[aria-pressed="true"] img {
  transform: rotate(0deg);
}

.sidebar-text {
  transition: opacity 140ms ease, transform 140ms ease;
}

.app-shell.sidebar-closed .sidebar-text,
.app-shell.sidebar-auto:not(.sidebar-hover) .sidebar-text {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

.sidebar-brand small {
  color: #aeb8c7;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  min-height: 0;
}

.side-nav button,
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #b9c2d0;
  min-width: 224px;
  position: relative;
  padding: 11px 12px;
  border-radius: 9px;
  font-weight: 650;
}

.side-nav button:hover,
.side-nav a:hover,
.side-nav button.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.side-nav button.active::before {
  content: "";
  position: absolute;
  left: -16px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.app-shell.admin-layout .client-nav-item {
  display: none;
}

.admin-menu {
  display: grid;
  gap: 7px;
  min-width: 286px;
  max-height: calc(100vh - 172px);
  overflow-y: auto;
  padding: 0 4px 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.admin-menu.hidden {
  display: none !important;
}

.admin-nav-group {
  display: grid;
  gap: 4px;
  padding: 7px 0 7px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-menu .nav-code {
  flex: 0 0 42px;
  color: #d7b77d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
}

.admin-menu button,
.admin-menu a {
  min-width: 0;
  width: 100%;
  gap: 8px;
  padding: 8px 9px;
}

.admin-menu button.active {
  background: rgba(255, 255, 255, 0.1);
}

.admin-menu button.active::before {
  left: -16px;
  height: 22px;
}

.admin-menu .admin-nav-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.admin-menu strong {
  font-size: 12px;
  line-height: 1.2;
}

.admin-menu small {
  color: #aeb8c7;
  font-size: 10px;
  line-height: 1.25;
}

.admin-menu .is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell.sidebar-closed .admin-menu,
.app-shell.sidebar-auto:not(.sidebar-hover) .admin-menu {
  min-width: 50px;
  overflow: hidden;
  padding-right: 0;
}

.app-shell.sidebar-closed .admin-nav-group,
.app-shell.sidebar-auto:not(.sidebar-hover) .admin-nav-group {
  border-left: 0;
  padding-left: 0;
}

.app-shell.sidebar-closed .admin-menu .nav-code,
.app-shell.sidebar-auto:not(.sidebar-hover) .admin-menu .nav-code {
  flex-basis: 30px;
  text-align: center;
}

.sidebar .ghost-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: auto;
  min-width: 224px;
}

.nav-icon {
  flex: 0 0 30px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: currentColor;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.app-shell.sidebar-closed .side-nav button,
.app-shell.sidebar-closed .side-nav a,
.app-shell.sidebar-auto:not(.sidebar-hover) .side-nav button,
.app-shell.sidebar-auto:not(.sidebar-hover) .side-nav a,
.app-shell.sidebar-closed .sidebar .ghost-action,
.app-shell.sidebar-auto:not(.sidebar-hover) .sidebar .ghost-action {
  min-width: 50px;
  padding-left: 10px;
  padding-right: 10px;
}

.mobile-nav-fab,
.mobile-nav-backdrop {
  display: none;
}

.main-content {
  min-width: 0;
  padding: 0 38px 50px;
}

.app-version-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 34px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.app-version-footer span:last-child {
  color: #8a95a6;
  font-weight: 650;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--brand);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 600;
}

h2 {
  color: var(--brand);
  font-size: 18px;
  font-weight: 750;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-chip,
.status-pill,
.doc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.user-chip {
  min-height: 39px;
  background: #e8edf5;
  color: var(--brand);
  padding: 8px 12px;
  font-weight: 700;
}

.filters-panel,
.panel,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.filters-panel {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  --tone: #356ae6;
  position: relative;
  padding: 17px 18px;
  overflow: hidden;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(23, 36, 58, 0.06);
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.metric-card strong {
  display: block;
  color: var(--brand);
  font-size: 25px;
  margin-top: 8px;
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tone);
}

.metric-card::after {
  content: "";
  position: absolute;
  top: 21px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.metric-card:nth-child(2) {
  --tone: #356ae6;
}

.metric-card:nth-child(3) {
  --tone: var(--purple);
}

.metric-card:nth-child(4) {
  --tone: var(--warn);
}

.metric-card:nth-child(5) {
  --tone: var(--ok);
}

.metric-card small,
.panel-head small {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 17px 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bar-list {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(145px, 220px) minmax(120px, 1fr) 26px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}

.bar-row span {
  color: #475467;
}

.bar-track {
  height: 6px;
  background: #edf0f3;
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--tone, var(--brand));
  border-radius: 8px;
}

.bar-row strong {
  color: var(--brand);
  font-size: 11px;
}

.attention-list {
  display: grid;
  gap: 0;
}

.attention-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid #eef0f3;
}

.attention-row:last-child {
  border-bottom: 0;
}

.attention-row .priority {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--tone);
}

.attention-row h3 {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
}

.attention-row p {
  margin: 5px 0 3px;
  color: var(--tone);
  font-size: 11px;
  font-weight: 700;
}

.attention-row small {
  color: var(--muted);
  font-size: 10px;
}

.attention-row button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 3px 0;
  font-size: 10px;
  font-weight: 750;
}

.document-overview-body {
  padding: 4px 0 0;
}

.document-overview-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.document-overview-top strong {
  color: var(--brand);
  font-size: 22px;
}

.document-overview-top span {
  color: var(--muted);
  font-size: 10px;
}

.document-overview-progress {
  height: 8px;
  margin: 13px 0 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0f3;
}

.document-overview-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 8px;
  background: var(--accent);
  transition: width 180ms ease;
}

.document-overview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef0f3;
}

.document-overview-legend span {
  color: var(--muted);
  font-size: 10px;
}

.document-overview-legend b {
  display: block;
  margin-bottom: 3px;
  color: var(--brand);
  font-size: 13px;
}

.document-overview-alert {
  padding-top: 15px;
}

.document-overview-alert span {
  color: var(--muted);
  font-size: 10px;
}

.document-overview-alert strong {
  display: block;
  margin-top: 4px;
  color: var(--warn);
  font-size: 11px;
}

.timeline-list {
  display: grid;
  padding-top: 2px;
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 11px 0;
}

.timeline-event:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 22px;
  bottom: -7px;
  width: 1px;
  background: var(--line);
}

.timeline-event i {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-event strong {
  display: block;
  color: var(--brand);
  font-size: 11px;
}

.timeline-event p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.timeline-event time {
  color: #98a2b3;
  font-size: 9px;
  white-space: nowrap;
}

.overview-secondary {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.overview-secondary span {
  color: var(--muted);
  padding: 0 22px;
  border-right: 1px solid var(--line);
  font-size: 10px;
  white-space: nowrap;
}

.overview-secondary span:last-child {
  border-right: 0;
}

.overview-secondary b {
  margin-right: 5px;
  color: var(--brand);
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ranking-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-size: 14px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel .panel-head {
  padding: 16px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 230px);
}

table {
  width: 100%;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.compact-table table {
  min-width: 1040px;
}

.process-table-wrap table {
  min-width: 1020px;
}

th,
td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: #4d5b6b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: #fbfcfe;
}

.muted {
  color: var(--muted);
}

.cell-wide {
  min-width: 240px;
}

.cell-mdic {
  min-width: 220px;
}

.cell-process-context {
  min-width: 320px;
}

.cell-text {
  max-height: 90px;
  min-width: 260px;
  overflow: auto;
  white-space: pre-line;
}

.status-pill {
  max-width: 240px;
  gap: 6px;
  padding: 6px 9px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  min-width: 0;
  line-height: 1.18;
  white-space: normal;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.info {
  background: var(--info-bg);
  color: var(--info);
}

.status-pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-pill.public {
  background: var(--purple-bg);
  color: var(--purple);
}

.status-pill.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.status-pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-pill.neutral {
  background: #eef2f6;
  color: #566273;
}

.status-pill-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.status-stack {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.status-stack .status-pill {
  width: 100%;
  max-width: none;
  white-space: normal;
}

.status-more-button {
  border: 1px solid var(--brand-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 9px;
}

.status-more-button:hover {
  background: var(--brand-soft);
}

.doc-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 360px;
  max-width: 430px;
}

.process-doc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.process-doc-pill.ok {
  color: #047857;
  background: rgba(4, 120, 87, 0.11);
}

.process-doc-pill.pendente {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.11);
}

.process-doc-pill.dispensado,
.process-doc-pill.vazio {
  color: #64748b;
  background: rgba(100, 116, 139, 0.11);
}

.doc-pill {
  width: 112px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.08;
  padding: 6px 8px;
  text-align: center;
  white-space: normal;
}

.doc-pill.ok {
  color: var(--ok);
  background: rgba(19, 117, 71, 0.12);
}

.doc-pill.pendente {
  color: var(--bad);
  background: rgba(173, 52, 52, 0.12);
}

.doc-pill.dispensado,
.doc-pill.vazio {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

.process-meta {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.process-meta-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.process-meta-tag {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.process-meta-value {
  min-width: 0;
  color: #111827;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.process-context {
  display: grid;
  gap: 6px;
  min-width: 300px;
}

.process-context-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.process-context-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 8px;
  background: #eef6ff;
  color: #175cd3;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.process-context-value {
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions button {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 500;
}

.row-actions button.danger {
  color: var(--bad);
}

.process-list-panel {
  padding: 0;
  overflow: hidden;
}

.process-list-head {
  padding: 15px 18px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.process-list {
  background: var(--surface);
}

.process-row-card {
  display: grid;
  grid-template-columns: minmax(270px, 2fr) minmax(165px, 0.85fr) minmax(280px, 1.15fr) minmax(132px, 0.55fr);
  gap: 20px;
  align-items: center;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(23, 36, 58, 0.24);
  transition: background 0.15s ease;
}

.process-row-card:last-child {
  border-bottom: 0;
}

.process-row-card:hover {
  background: #fafbfc;
}

.process-row-card.has-client-request {
  background: #fff8f1;
  box-shadow: inset 4px 0 0 #e85d04;
}

.process-row-card.has-client-request:hover {
  background: #fff3e8;
}

.internal-process-stats .hub-stat {
  cursor: default;
}

.internal-process-stats {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.internal-process-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.internal-process-list {
  display: grid;
  gap: 0;
  max-height: calc(100vh - 320px);
  overflow: auto;
}

.internal-process-card .process-row-main {
  display: grid;
  gap: 7px;
}

.internal-process-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.internal-process-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  background: #eef6ff;
  color: #175cd3;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 750;
}

.internal-process-history-preview {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.internal-process-modal-panel {
  width: min(640px, 100%);
}

.internal-process-domain {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 1000px) {
  .internal-process-filters,
  .internal-process-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .internal-process-filters,
  .internal-process-stats {
    grid-template-columns: 1fr;
  }
}

.billing-page-head {
  align-items: end;
}

.billing-search-field {
  width: min(420px, 100%);
}

.billing-report-stats {
  grid-template-columns: repeat(5, minmax(135px, 1fr));
}

.billing-report-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.billing-quick {
  justify-content: flex-end;
}

.billing-quick button span {
  margin-left: 5px;
  opacity: 0.72;
}

.billing-report-panel {
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(23, 36, 58, 0.06);
}

.billing-process-list {
  overflow: hidden;
  background: #fff;
}

.billing-process-list .billing-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(245px, 0.42fr) minmax(405px, 1.05fr) 88px;
  gap: 18px;
  align-items: stretch;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.billing-process-list .billing-card:last-child {
  border-bottom: 0;
}

.billing-process-list .process-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 20px 4px 0;
  border-right: 1px solid #edf0f4;
}

.billing-process-list .company {
  margin: 0;
  color: #17243a;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.28;
  text-transform: uppercase;
}

.billing-process-list .equipment {
  margin-top: 6px;
  color: #3d4d66;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.billing-process-list .context {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.billing-process-list .process-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.billing-process-list .process-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: #526177;
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 650;
}

.billing-process-list .card-body {
  display: contents;
}

.billing-process-list .summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
}

.billing-process-list .status {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 800;
}

.billing-process-list .status.partial {
  background: #eef8fc;
  color: #176b91;
}

.billing-process-list .status.received {
  background: var(--ok-bg);
  color: var(--ok);
}

.billing-process-list .status.pending {
  background: var(--warn-bg);
  color: var(--warn);
}

.billing-process-list .status.none {
  background: #f1f4f7;
  color: var(--muted);
}

.billing-process-list .metric {
  padding: 12px 13px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.billing-process-list .metric.total {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
}

.billing-process-list .metric.received {
  border-right: 1px solid var(--line);
}

.billing-process-list .metric b {
  display: block;
  margin-bottom: 4px;
  color: #17243a;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
}

.billing-process-list .metric.received b {
  color: var(--ok);
}

.billing-process-list .metric.pending b {
  color: var(--warn);
}

.billing-process-list .installments {
  min-width: 0;
}

.billing-process-list .installments-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 29px;
  margin-bottom: 5px;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.billing-process-list .installments-title span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.billing-process-list .installment-list {
  display: grid;
  gap: 7px;
  max-height: 228px;
  overflow: auto;
  padding-right: 4px;
}

.billing-process-list .installment {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 11px 8px 15px;
  box-shadow: 0 2px 7px rgba(23, 36, 58, 0.025);
}

.billing-process-list .installment::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #98a2b3;
}

.billing-process-list .installment.received::before {
  background: #1e9b70;
}

.billing-process-list .installment.pending::before {
  background: #e4a13a;
}

.billing-process-list .installment strong {
  display: block;
  color: #26344b;
  font-size: 10px;
}

.billing-process-list .installment > strong {
  flex: 0 0 auto;
  font-size: 11px;
  white-space: nowrap;
}

.billing-process-list .pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  border-radius: 12px;
  padding: 3px 7px;
  font-size: 7px;
  font-weight: 800;
}

.billing-process-list .received .pill {
  background: var(--ok-bg);
  color: var(--ok);
}

.billing-process-list .pending .pill {
  background: var(--warn-bg);
  color: var(--warn);
}

.billing-process-list .pill.extra {
  margin-left: 4px;
  background: #dbeafe;
  color: #0f2a5f;
}

.billing-process-list .installment-date {
  display: block;
  margin-top: 5px;
  color: var(--ok);
  font-size: 8px;
  font-weight: 750;
}

.billing-process-list .empty {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 75px;
  border: 1px dashed #d9dfe7;
  border-radius: 9px;
  background: #fafbfc;
  color: var(--muted);
  padding: 13px 14px 13px 42px;
  font-size: 9px;
  line-height: 1.35;
}

.billing-process-list .empty::before {
  content: "+";
  position: absolute;
  left: 13px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #edf0f4;
  color: #475467;
  font-size: 12px;
}

.billing-process-list .empty b {
  display: block;
  margin-bottom: 4px;
  color: #475467;
  font-size: 9px;
}

.billing-process-list .billing-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.billing-process-list .billing-actions button {
  min-width: 88px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #17243a;
  padding: 0 10px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.billing-process-list .billing-actions button:hover {
  background: #f6f8fa;
}

.billing-process-list .billing-actions .primary {
  border-color: #17243a;
  background: #17243a;
  color: #fff;
}

.billing-process-list .billing-actions .primary:hover {
  background: #233650;
}

.billing-process-list .billing-actions .danger {
  border-color: rgba(173, 52, 52, 0.24);
  background: rgba(254, 226, 226, 0.3);
  color: var(--bad);
}

.billing-process-list .billing-actions .danger:hover {
  background: rgba(254, 226, 226, 0.55);
}

@media (max-width: 1180px) {
  .billing-report-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-page-head,
  .billing-report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-quick {
    justify-content: flex-start;
  }
}

@media (max-width: 1050px) {
  .billing-process-list .billing-card {
    grid-template-columns: minmax(250px, 1fr) 220px minmax(290px, 360px);
  }

  .billing-process-list .billing-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }

  .billing-process-list .billing-actions button {
    min-width: 100px;
  }
}

@media (max-width: 780px) {
  .billing-process-list .billing-card {
    grid-template-columns: minmax(240px, 1fr) 220px;
  }

  .billing-process-list .process-head {
    grid-column: 1 / -1;
    align-items: flex-start;
    border-right: 0;
    border-bottom: 1px solid #edf0f4;
    padding: 0 0 15px;
  }

  .billing-process-list .billing-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .billing-report-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .billing-report-panel {
    border-radius: 0;
    box-shadow: none;
  }

  .billing-process-list .billing-card {
    display: block;
    padding: 18px 15px;
  }

  .billing-process-list .process-head {
    display: block;
    margin-bottom: 14px;
  }

  .billing-process-list .summary {
    margin-bottom: 14px;
  }

  .billing-process-list .card-body {
    display: block;
  }

  .billing-process-list .card-body > section {
    margin-bottom: 14px;
  }

  .billing-process-list .context {
    line-height: 1.5;
  }

  .billing-process-list .billing-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .billing-process-list .billing-actions button {
    width: 100%;
  }

  .billing-process-list .process-meta span {
    font-size: 8px;
  }

  .billing-process-list .installment {
    min-height: 54px;
  }
}

.process-row-main {
  min-width: 0;
}

.process-row-main h3 {
  margin: 0;
  color: #17243a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.22;
  text-transform: uppercase;
}

.client-request-row-tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  margin-bottom: 7px;
  border: 1px solid rgba(232, 93, 4, 0.28);
  border-radius: 999px;
  background: #fff1e6;
  color: #9a3412;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.client-request-row-tag small {
  color: #b45309;
  font-size: 10px;
  font-weight: 750;
}

.process-row-equipment {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.process-row-equipment strong {
  color: #465364;
  font-weight: 800;
}

.process-row-main p {
  margin: 4px 0 0;
  color: #53627a;
  font-size: 12px;
  line-height: 1.35;
}

.process-row-mdic {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.process-row-mdic span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #e2e7ee;
  border-radius: 999px;
  background: #fff;
  padding: 3px 8px;
}

.process-row-status {
  min-width: 0;
}

.process-row-status .status-stack {
  width: 100%;
  min-width: 0;
  max-width: 230px;
}

.process-row-status .status-more-button {
  min-height: 32px;
  border-color: #dce3ed;
  border-radius: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 650;
  padding: 6px 9px;
}

.process-row-docs {
  min-width: 0;
}

.process-doc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.process-doc-summary strong,
.process-doc-summary span {
  font-size: 10px;
}

.process-doc-summary strong {
  color: #475467;
  font-weight: 800;
}

.process-doc-summary span {
  color: var(--muted);
}

.process-doc-summary .process-doc-percent {
  margin-left: 3px;
  font-weight: 800;
  white-space: nowrap;
}

.process-doc-summary .process-doc-percent.ok {
  color: var(--ok);
}

.process-doc-summary .process-doc-percent.warn {
  color: var(--warn);
}

.process-doc-summary .process-doc-percent.bad {
  color: var(--bad);
}

.process-doc-compact-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 7px;
}

.process-doc-compact-item {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #667085;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.process-doc-compact-item i {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.process-doc-compact-item.ok {
  border-color: rgba(22, 128, 93, 0.34);
  background: rgba(22, 128, 93, 0.12);
  color: var(--ok);
}

.process-doc-compact-item.ok i {
  background: rgba(22, 128, 93, 0.16);
  color: var(--ok);
}

.process-doc-compact-item.wait {
  border-color: rgba(164, 98, 8, 0.34);
  background: rgba(164, 98, 8, 0.12);
  color: var(--warn);
}

.process-doc-compact-item.wait i {
  background: rgba(164, 98, 8, 0.16);
  color: var(--warn);
}

.process-doc-compact-item.waived {
  border-color: rgba(100, 116, 139, 0.34);
  background: rgba(100, 116, 139, 0.12);
  color: #53657d;
}

.process-doc-compact-item.waived i {
  background: rgba(100, 116, 139, 0.16);
  color: #53657d;
}

.process-doc-compact-item.neutral {
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
}

.process-doc-compact-item.neutral i {
  background: rgba(100, 116, 139, 0.13);
  color: #667085;
}

.process-row-actions {
  justify-self: end;
}

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

.process-row-actions .row-actions button {
  padding: 7px 9px;
  font-size: 11px;
}

.process-list-empty {
  padding: 38px;
  text-align: center;
}

.modal-open {
  overflow: hidden;
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.history-modal-panel {
  width: min(1320px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.history-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.history-modal-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.history-modal-process-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 8px 0 0;
  color: var(--text);
  font-family: var(--app-font-family);
  font-size: 14px;
  line-height: 1.4;
}

.history-meta-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

.history-modal-process-meta strong {
  font-weight: 700;
}

.modal-close-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.history-modal-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.history-modal-status {
  display: flex;
  justify-content: flex-start;
}

.history-modal-status .status-pill {
  max-width: 100%;
}

.history-detail-section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-detail-section h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.history-modal-text {
  white-space: pre-line;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

.history-section-head,
.history-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-section-head h3 {
  margin: 0;
}

.observations-section-head {
  align-items: center;
}

.client-observation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.client-observation-button {
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.client-request-notice {
  display: grid;
  gap: 10px;
}

.client-request-notice.has-admin-card {
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.86fr);
  align-items: start;
}

.client-request-content-card,
.client-request-admin-actions {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.client-request-content-card,
.client-request-admin-actions,
.observation-note-card {
  height: 100%;
}

.client-request-content-card {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.observation-meta-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.observation-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #fff;
  color: #53627a;
  padding: 3px 8px;
  font-family: "Calibri Light", Calibri, Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.2;
  white-space: nowrap;
}

.observation-meta-pill b {
  margin-right: 4px;
  color: #344054;
  font-weight: 300;
}

.client-request-content-card p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
}

.observation-card-stack {
  display: grid;
  gap: 10px;
}

.observation-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.observation-card-row.has-pair {
  grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.72fr);
}

.observation-note-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.observation-card-top {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.observation-card-top .observation-meta-pills {
  flex: 1 1 auto;
  min-width: 0;
}

.observation-card-check {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #dcfce7;
  font-size: 14px;
  line-height: 1;
}

.observation-note-card p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
}

.observation-note-request {
  border-color: #fed7aa;
  background: #fffaf5;
}

.observation-note-response {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.observation-note-resolved {
  border-color: #bbf7d0;
  background: #f7fef9;
}

.client-request-admin-actions {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.client-request-action-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.client-request-action-head > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ecfdf3;
  font-size: 15px;
}

.client-request-action-head strong {
  display: block;
  color: #17243a;
  font-size: 13px;
  font-weight: 900;
}

.client-request-action-head small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.client-request-resolve-button {
  justify-self: start;
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.client-request-reply-form {
  display: grid;
  gap: 8px;
}

.client-request-reply-form label {
  display: grid;
  gap: 5px;
}

.client-request-reply-form label span {
  color: #344054;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.client-request-reply-form textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid #dde5ef;
  border-radius: 7px;
  background: #fff;
  color: #17243a;
  padding: 8px 9px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.client-request-reply-form button {
  justify-self: start;
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

@media (max-width: 820px) {
  .client-request-notice.has-admin-card,
  .observation-card-row.has-pair {
    grid-template-columns: 1fr;
  }
}

.history-full-button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

.history-full-button:hover {
  border-color: #b9c6d4;
  background: var(--surface);
}

.history-entry-list {
  display: grid;
  gap: 8px;
}

.history-entry {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
}

.history-entry time {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.history-entry p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.billing-detail-section {
  gap: 10px;
}

.billing-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.billing-summary-cards span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 11px;
}

.billing-summary-cards b {
  color: var(--brand);
  font-size: 15px;
}

.billing-summary-cards .received b {
  color: var(--ok);
}

.billing-summary-cards .pending b {
  color: var(--warn);
}

.billing-installment-list {
  display: grid;
  gap: 7px;
}

.billing-installment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  padding: 9px 10px;
}

.billing-installment-item strong,
.billing-installment-item span {
  color: #344054;
  font-size: 13px;
}

.billing-installment-item small {
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 10px;
  font-weight: 700;
}

.billing-installment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 3px;
}

.billing-installment-meta small {
  margin-top: 0;
}

.billing-installment-item small.billing-pending-reason-tag {
  background: #dbeafe;
  color: #0f2a5f;
}

.billing-installment-item small.billing-payment-date-tag {
  background: var(--ok-bg);
  color: var(--ok);
}

.billing-installment-date-line {
  display: block;
  margin-top: 5px;
  color: var(--ok);
  font-size: 11px;
  font-weight: 750;
}

.billing-installment-item.received small {
  background: var(--ok-bg);
  color: var(--ok);
}

.billing-installment-item.received span {
  color: var(--ok);
}

.billing-notes {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.billing-notes strong {
  color: #344054;
  font-size: 12px;
}

.billing-notes p {
  margin: 3px 0 0;
  color: #344054;
  font-size: 13px;
  white-space: pre-line;
}

.billing-section-head {
  align-items: center;
  gap: 10px;
}

.client-billing-edit-button {
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.pending-confirmation-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.billing-installment-item .pending-confirmation-tag {
  margin-top: 0;
  color: var(--warn);
}

.pending-billing-request {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(176, 116, 0, 0.22);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.58);
  padding: 10px;
}

.pending-billing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pending-billing-head strong {
  color: #344054;
  font-size: 13px;
}

.pending-billing-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pending-billing-summary span {
  background: rgba(255, 255, 255, 0.82);
}

.pending-billing-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.pending-billing-actions button {
  min-height: 32px;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
}

.pending-billing-reject-button {
  border-color: rgba(173, 52, 52, 0.24);
  background: rgba(254, 226, 226, 0.3);
  color: var(--bad);
}

.mdic-panel-section {
  gap: 12px;
}

.mdic-panel-head,
.mdic-panel-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mdic-panel-head {
  justify-content: space-between;
}

.mdic-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mdic-code {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(23, 107, 135, 0.35);
  background: rgba(23, 107, 135, 0.1);
  color: var(--brand-strong);
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 650;
}

.mdic-panel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.mdic-panel-button:hover {
  background: var(--surface);
  border-color: #b9c6d4;
}

.mdic-panel-button-compact {
  min-height: 28px;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
}

.mdic-panel-embed {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mdic-panel-embed summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 650;
}

.mdic-powerbi-frame {
  width: 100%;
  height: 430px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mdic-results {
  display: grid;
  gap: 12px;
}

.mdic-results-updated {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mdic-result-block {
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 10px 10px;
}

.mdic-result-block::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: rgba(23, 107, 135, 0.28);
}

.mdic-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mdic-result-head h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.mdic-result-head span {
  color: var(--muted);
  font-size: 12px;
}

.mdic-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mdic-results-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  color: #2f3746;
  font-family: var(--app-font-family);
  font-size: 13px;
  line-height: 1.25;
}

.mdic-results-table th,
.mdic-results-table td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.mdic-results-table th {
  border-bottom: 1px solid #2f7edb;
  background: #202124;
  color: #fff;
  font-weight: 650;
  white-space: nowrap;
}

.mdic-results-table-consulta th {
  background: #cfe8ff;
  color: #27364a;
}

.mdic-results-table td {
  border-top: 1px solid #eef2f7;
}

.mdic-results-table tr:nth-child(even) td {
  background: #f6f8fb;
}

.mdic-description-cell {
  min-width: 420px;
  max-width: 620px;
}

.mdic-catalog-link {
  color: var(--brand-strong);
  font-weight: 650;
  text-decoration: none;
}

.mdic-catalog-link:hover {
  text-decoration: underline;
}

.mdic-panel-message {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: #344054;
  background: #fff;
  font-size: 13px;
}

.mdic-panel-message-loading {
  border-color: rgba(23, 107, 135, 0.24);
  background: rgba(23, 107, 135, 0.08);
  color: var(--brand-strong);
}

.mdic-panel-message-empty {
  color: var(--muted);
}

.mdic-panel-message-error {
  border-color: rgba(194, 65, 12, 0.22);
  background: rgba(254, 243, 199, 0.45);
  color: #9a3412;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.document-card {
  --tone: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px 18px;
  box-shadow: none;
}

.document-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.document-card-head i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--tone);
}

.document-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 25px;
}

.document-card small {
  color: var(--muted);
  font-size: 10px;
}

.document-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
}

.process-viewbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.document-tabs {
  display: flex;
  padding: 3px;
  border-radius: 9px;
  background: #e9ecf0;
}

.document-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
}

.document-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(24, 38, 60, 0.09);
}

.document-quick,
.process-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.document-quick button,
.process-quick button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 10px;
}

.document-quick button.active,
.process-quick button.active {
  border-color: #d5b57e;
  background: #fffaf1;
  color: #7d581d;
}

.document-quick button:hover,
.process-quick button:hover {
  border-color: #d3d9e3;
  color: var(--brand);
}

.document-process-panel {
  padding: 0;
}

.document-process-panel .panel-head {
  margin: 0;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.document-process-list {
  display: grid;
}

.document-process-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) minmax(150px, 0.6fr) minmax(360px, 2fr) 28px;
  gap: 22px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #eef0f3;
}

.document-process-row:last-child {
  border-bottom: 0;
}

.document-process-row:hover {
  background: #fafbfc;
}

.document-row-eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-process-main h3 {
  margin: 0;
  color: var(--brand);
  font-size: 14px;
  line-height: 1.35;
}

.document-process-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.document-row-count strong {
  display: block;
  color: #475467;
  font-size: 12px;
}

.document-row-count span {
  color: var(--warn);
  font-size: 10px;
  font-weight: 700;
}

.document-row-count span.ok {
  color: var(--ok);
}

.document-row-progress {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf0f3;
}

.document-row-progress i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--accent);
}

.document-row-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 7px;
}

.document-chip {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #667085;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.document-chip i {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
}

.document-chip.ok {
  border-color: rgba(22, 128, 93, 0.34);
  background: rgba(22, 128, 93, 0.12);
  color: var(--ok);
}

.document-chip.ok i {
  background: rgba(22, 128, 93, 0.16);
}

.document-chip.wait {
  border-color: rgba(164, 98, 8, 0.34);
  background: rgba(164, 98, 8, 0.12);
  color: var(--warn);
}

.document-chip.wait i {
  background: rgba(164, 98, 8, 0.16);
}

.document-chip.skip,
.document-chip.neutral {
  border-color: rgba(100, 116, 139, 0.28);
  background: rgba(100, 116, 139, 0.1);
  color: #53657d;
}

.document-chip.skip i,
.document-chip.neutral i {
  background: rgba(100, 116, 139, 0.14);
}

.document-open-button {
  border: 0;
  background: transparent;
  color: #89919e;
  padding: 2px;
  font-size: 22px;
  line-height: 1;
}

.document-empty {
  padding: 28px 18px;
  text-align: center;
}

.document-type-list {
  display: grid;
  padding: 6px 18px 18px;
}

.document-type-row {
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr) 170px;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #eef0f3;
}

.document-type-row:last-child {
  border-bottom: 0;
}

.document-type-row strong {
  color: var(--brand);
  font-size: 12px;
}

.document-type-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.document-type-row span {
  color: var(--muted);
  font-size: 10px;
}

.document-type-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf0f3;
}

.document-type-progress i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--ok);
}

.admin-panel {
  margin-bottom: 16px;
}

.hub-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  padding: 10px 13px;
}

.hub-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hub-stat {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 15px;
}

.hub-stat span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hub-stat strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.admin-pane {
  display: grid;
  gap: 16px;
}

.inline-filter {
  width: min(220px, 100%);
}

.company-table {
  min-width: 1080px;
}

.company-table-wrap {
  max-height: 390px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 9px;
  text-transform: uppercase;
}

.type-pill.cliente {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.type-pill.pleiteante {
  background: var(--warn-bg);
  color: var(--warn);
}

.type-pill.fabricante {
  background: var(--ok-bg);
  color: var(--ok);
}

.type-pill.admin {
  background: #eef2f6;
  color: #344054;
}

.type-pill.situation-category {
  background: #eef2f6;
  color: #344054;
}

.type-pill.access-login_senha {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.type-pill.access-link_direto {
  background: var(--ok-bg);
  color: var(--ok);
}

.situation-filters,
.access-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.access-refresh-button {
  align-self: end;
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.situation-table {
  min-width: 760px;
}

.situation-table-wrap {
  max-height: 430px;
}

.access-table {
  min-width: 980px;
}

.access-table-wrap {
  max-height: 460px;
}

.access-user-cell {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.access-user-cell strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.access-user-cell small {
  color: var(--muted);
  font-size: 12px;
}

.access-user-agent {
  max-width: 360px;
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

.user-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-access-box {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.user-access-box h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.user-access-box small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.user-access-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.user-access-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  color: #344054;
  font-size: 12px;
}

.user-access-option input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
}

.user-access-option span {
  overflow-wrap: anywhere;
}

.company-users-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.company-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.company-users-head h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-users-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.company-users-list {
  display: grid;
  gap: 8px;
}

.company-user-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.company-user-card strong,
.company-user-card small {
  display: block;
}

.company-user-card strong {
  color: #344054;
  font-size: 13px;
}

.company-user-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.company-user-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.company-user-form-grid button {
  min-height: 38px;
}

.user-table {
  min-width: 900px;
}

.user-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.user-access-summary {
  display: grid;
  gap: 4px;
  min-width: 280px;
  max-width: 520px;
  color: #344054;
  font-size: 12px;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: span 2;
}

.doc-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.process-files-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.process-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.process-files-head h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.process-files-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.process-files-actions {
  width: min(650px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.process-files-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px dashed rgba(23, 107, 135, 0.42);
  border-radius: 8px;
  background: rgba(23, 107, 135, 0.06);
  color: var(--brand-strong);
  padding: 10px 12px;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.process-files-dropzone strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.process-files-dropzone span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.process-files-dropzone.is-dragover {
  border-color: var(--brand);
  background: rgba(23, 107, 135, 0.13);
}

.process-files-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.process-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

.process-upload-button {
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.process-upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.process-files-queue {
  display: grid;
  gap: 8px;
}

.process-files-queue-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #344054;
  font-size: 12px;
}

.process-files-queue-head span {
  color: var(--muted);
}

.process-files-queue-items {
  display: grid;
  gap: 8px;
}

.process-pending-file {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
}

.process-pending-file-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.process-pending-file-info strong {
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.process-pending-file-info small {
  color: var(--muted);
  font-size: 11px;
}

.process-pending-file input {
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
}

.process-pending-file-remove {
  min-height: 30px;
  border: 1px solid rgba(173, 52, 52, 0.24);
  border-radius: 6px;
  background: rgba(254, 226, 226, 0.32);
  color: var(--bad);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 650;
}

.process-files-list {
  min-width: 0;
}

.process-files-items {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.process-file-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 360px;
  min-height: 34px;
  border: 1px solid #008768;
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.11);
  color: #047857;
  padding: 7px 12px;
}

.process-file-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.process-file-main a,
.process-file-main span {
  min-width: 0;
  color: #047857;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.process-file-main a:hover {
  text-decoration: underline;
}

.process-file-main small {
  color: rgba(4, 120, 87, 0.78);
  font-size: 10px;
  line-height: 1.3;
}

.process-file-delete {
  flex: 0 0 auto;
  min-height: 22px;
  border: 1px solid rgba(4, 120, 87, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: #047857;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
}

.process-file-delete:hover {
  border-color: rgba(173, 52, 52, 0.38);
  background: rgba(254, 226, 226, 0.66);
  color: var(--bad);
}

.process-files-empty,
.process-files-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.process-files-message {
  min-height: 17px;
}

.text-grid {
  grid-template-columns: 1.35fr 1fr 0.75fr;
}

.history-form-field {
  align-content: start;
}

.billing-form-field {
  display: grid;
  align-content: start;
  gap: 10px;
}

.billing-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-form-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-disabled-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.billing-disabled-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.billing-disabled-track {
  position: relative;
  width: 42px;
  height: 22px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: #d7dee8;
  transition: background 0.16s ease;
}

.billing-disabled-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.16s ease;
}

.billing-disabled-switch input:checked + .billing-disabled-track {
  background: var(--brand-strong);
}

.billing-disabled-switch input:checked + .billing-disabled-track::after {
  transform: translateX(20px);
}

.billing-disabled-switch input:focus-visible + .billing-disabled-track {
  outline: 2px solid rgba(23, 107, 135, 0.35);
  outline-offset: 2px;
}

.billing-add-button,
.billing-generate-button {
  min-height: 28px;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
}

.billing-generator {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(130px, 0.7fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.billing-generator label,
.billing-notes-field {
  display: grid;
  gap: 5px;
}

.billing-generator span,
.billing-notes-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.billing-generator input {
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 9px;
}

.billing-form-rows {
  display: grid;
  gap: 8px;
}

.billing-form-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(105px, 0.45fr) minmax(110px, 0.45fr) minmax(130px, 0.52fr) minmax(190px, 0.75fr) auto;
  gap: 8px;
  align-items: center;
}

.billing-form-row input,
.billing-form-row select {
  min-height: 36px;
}

.billing-payment-date-input:required:not(:disabled):invalid {
  border-color: rgba(173, 52, 52, 0.62);
  box-shadow: 0 0 0 3px rgba(173, 52, 52, 0.12);
}

.billing-pending-reason-input:disabled,
.billing-payment-date-input:disabled {
  background: #f8fafc;
  color: var(--muted);
  opacity: 0.72;
}

.billing-remove-button {
  min-height: 34px;
  border: 1px solid rgba(173, 52, 52, 0.24);
  border-radius: 6px;
  background: rgba(254, 226, 226, 0.32);
  color: var(--bad);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 650;
}

.billing-remove-button:hover {
  border-color: rgba(173, 52, 52, 0.42);
  background: rgba(254, 226, 226, 0.55);
}

.client-billing-modal,
.client-note-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: center;
  justify-items: center;
  background: rgba(15, 23, 42, 0.46);
  padding: 18px;
}

.client-billing-modal.hidden,
.client-note-modal.hidden {
  display: none;
}

.client-billing-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.client-note-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(620px, 100%);
  max-height: min(84vh, 620px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.client-billing-form {
  overflow: auto;
  padding: 16px;
}

.client-note-form {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.client-note-selected-type {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 28px;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #344054;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

#clientBillingEditableFields {
  display: grid;
  gap: 8px;
}

#clientBillingEditableFields.is-disabled {
  opacity: 0.7;
}

.history-add-button {
  min-height: 28px;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
}

.history-form-rows {
  display: grid;
  gap: 8px;
}

.history-form-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.history-form-row input {
  min-height: 38px;
}

.history-remove-button {
  min-height: 34px;
  border: 1px solid rgba(173, 52, 52, 0.24);
  border-radius: 6px;
  background: rgba(254, 226, 226, 0.32);
  color: var(--bad);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 650;
}

.history-remove-button:hover {
  border-color: rgba(173, 52, 52, 0.42);
  background: rgba(254, 226, 226, 0.55);
}

.task-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.task-page-head h2 {
  margin: 2px 0 4px;
  color: var(--brand);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.task-page-head small {
  color: var(--muted);
}

.task-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.task-stat {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
  text-align: left;
}

.task-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--tone);
}

.task-stat.active {
  border-color: #d5b57e;
  background: #fffdf8;
}

.task-stat span,
.task-stat small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.task-stat strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--brand);
  font-size: 25px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 14px;
  align-items: start;
}

.task-filter-panel,
.task-list-panel,
.task-side-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: 7vh 18px 24px;
  background: rgba(15, 23, 42, 0.48);
  overflow-y: auto;
}

.task-modal-panel {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.task-modal-form {
  padding: 18px;
}

.task-filter-panel {
  margin-bottom: 14px;
}

.task-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.45fr) minmax(150px, 0.45fr);
  gap: 10px;
  align-items: end;
}

.task-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.task-quick button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 10px;
}

.task-quick button.active {
  border-color: #d5b57e;
  background: #fffaf1;
  color: #7d581d;
}

.task-list {
  display: grid;
  gap: 9px;
}

.task-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(145px, auto);
  gap: 11px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.task-tone-ok {
  --tone: var(--ok);
}

.task-tone-bad {
  --tone: var(--bad);
}

.task-tone-warn {
  --tone: var(--warn);
}

.task-tone-info {
  --tone: var(--info);
}

.task-tone-neutral {
  --tone: #7f8da1;
}

.task-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.task-check.done {
  border-color: var(--ok);
  background: var(--ok);
}

.task-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-card h3 {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
}

.task-card p {
  margin: 7px 0 0;
  color: #475467;
  font-size: 12px;
}

.task-priority {
  flex: 0 0 auto;
  border: 1px solid rgba(102, 112, 133, 0.24);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--tone);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
}

.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.task-meta-row span {
  border: 1px solid #edf0f3;
  border-radius: 999px;
  background: #fafbfc;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 10px;
}

.task-audit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.task-audit-row span {
  border-radius: 999px;
  background: #eef6ff;
  color: #12355b;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 650;
}

.task-card-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  text-align: right;
}

.task-card-side strong {
  color: var(--tone);
  font-size: 11px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.task-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
}

.task-empty {
  border: 1px dashed #d9dee8;
  border-radius: 8px;
  background: #fafbfc;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.task-empty-warning {
  border-color: #f2b8b5;
  background: #fff7f6;
  color: var(--bad);
}

.task-side-column {
  display: grid;
  gap: 14px;
}

.task-side-panel h2 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 13px;
}

.task-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.task-progress-top strong {
  color: var(--brand);
}

.task-progress-track {
  height: 7px;
  border-radius: 999px;
  background: #edf0f3;
  overflow: hidden;
  margin-top: 10px;
}

.task-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}

.task-upcoming-list {
  display: grid;
  gap: 10px;
}

.task-upcoming-item {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #eef0f3;
  padding-bottom: 10px;
}

.task-upcoming-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.task-upcoming-item span,
.task-upcoming-item small {
  color: var(--muted);
  font-size: 10px;
}

.task-upcoming-item strong {
  color: var(--brand);
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-open) minmax(0, 1fr);
  }

  .app-shell.sidebar-closed,
  .app-shell.sidebar-auto {
    grid-template-columns: var(--sidebar-closed) minmax(0, 1fr);
  }

  .app-shell.sidebar-auto.sidebar-hover {
    grid-template-columns: var(--sidebar-open) minmax(0, 1fr);
  }

  .filters-panel,
  .kpi-grid,
  .document-grid,
  .hub-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .ranking-grid,
  .text-grid {
    grid-template-columns: 1fr;
  }

  .task-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-process-row {
    grid-template-columns: minmax(220px, 1.4fr) 130px minmax(260px, 1.7fr) 28px;
    gap: 16px;
  }

  .process-row-card {
    grid-template-columns: minmax(240px, 2fr) minmax(155px, 0.8fr) minmax(230px, 1.1fr) minmax(120px, 0.5fr);
    gap: 16px;
  }

  .doc-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 40;
    height: 58px;
    padding: 7px 14px;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  }

  .app-shell.sidebar-closed .sidebar,
  .app-shell.sidebar-auto:not(.sidebar-hover) .sidebar {
    padding: 7px 14px;
  }

  .sidebar-head {
    width: 100%;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 0;
  }

  .sidebar-brand {
    gap: 10px;
  }

  .sidebar-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 8px;
  }

  .sidebar-brand-mark img {
    width: 30px;
    height: 30px;
  }

  .sidebar-brand strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .sidebar-brand small {
    margin-top: 3px;
    color: #aeb8c7;
    font-size: 11px;
  }

  .app-shell.sidebar-closed .sidebar-text,
  .app-shell.sidebar-auto:not(.sidebar-hover) .sidebar-text {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .sidebar-pin-button {
    display: none;
  }

  .main-content {
    padding: 86px 14px 108px;
  }

  .app-version-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-nav-fab {
    position: fixed;
    right: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border: 0;
    border-radius: 50%;
    background: #08a36c;
    color: #fff;
    box-shadow: 0 18px 40px rgba(8, 163, 108, 0.3);
    font-size: 0;
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  }

  .mobile-nav-fab::before,
  .mobile-nav-fab::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 31px;
    height: 5px;
    border-radius: 999px;
    background: #fff;
    transform: translate(-50%, -50%);
  }

  .mobile-nav-fab::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .app-shell.mobile-nav-open .mobile-nav-fab {
    background: var(--brand);
    box-shadow: 0 18px 40px rgba(23, 36, 58, 0.28);
    transform: rotate(45deg);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 58px 0 0;
    z-index: 34;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .app-shell.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .side-nav {
    position: fixed;
    right: 18px;
    bottom: calc(180px + env(safe-area-inset-bottom));
    z-index: 45;
    width: min(272px, calc(100vw - 36px));
    gap: 10px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .app-shell.mobile-nav-open .side-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .side-nav .admin-only.hidden {
    display: none !important;
  }

  .admin-menu {
    width: 100%;
    min-width: 0;
    max-height: min(62vh, 520px);
    gap: 8px;
    padding: 0;
  }

  .admin-nav-group {
    gap: 7px;
    padding: 8px 0 8px 8px;
  }

  .admin-menu button,
  .admin-menu a {
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
  }

  .admin-menu .nav-code {
    flex-basis: 42px;
  }

  .side-nav button,
  .side-nav a,
  .side-nav .unified-nav-link,
  .sidebar .ghost-action,
  .sidebar .sidebar-footer-action {
    min-width: 0;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(23, 36, 58, 0.96);
    color: #eef4fb;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
    padding: 15px 16px;
    font-size: 16px;
    font-weight: 750;
  }

  .side-nav button.active,
  .side-nav .unified-nav-link.active,
  .side-nav .unified-nav-link.is-active {
    background: #2b3a50;
    color: #fff;
  }

  .side-nav button.active::before,
  .side-nav .unified-nav-link.active::before,
  .side-nav .unified-nav-link.is-active::before {
    left: -18px;
    height: 26px;
    background: var(--accent);
  }

  .sidebar .ghost-action,
  .sidebar .sidebar-footer-action {
    position: fixed;
    right: 18px;
    bottom: calc(108px + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    max-width: min(272px, calc(100vw - 36px));
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .app-shell.mobile-nav-open .sidebar .ghost-action,
  .app-shell.mobile-nav-open .sidebar .sidebar-footer-action {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .nav-icon svg {
    width: 21px;
    height: 21px;
  }

  .topbar,
  .hub-title,
  .process-files-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-height: auto;
    margin: 0 0 20px;
    padding-bottom: 10px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar .eyebrow {
    margin-bottom: 3px;
  }

  .topbar h1 {
    font-size: 28px;
    line-height: 1.08;
  }

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

  .topbar-actions {
    flex: 0 0 auto;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .topbar-actions .secondary-action {
    display: none !important;
  }

  .user-chip {
    min-height: 40px;
    max-width: 46vw;
    border-radius: 999px;
    padding: 9px 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
  }

  .process-files-actions,
  .process-pending-file {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .filters-panel,
  .document-grid,
  .hub-stats,
  .user-access-grid,
  .company-user-card,
  .company-user-form-grid,
  .task-stats,
  .task-search-row,
  .task-side-column,
  .form-grid,
  .doc-form-grid {
    grid-template-columns: 1fr;
  }

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

  #documentsView .document-grid {
    display: none;
  }

  .filters-panel {
    display: block;
    margin: -4px 0 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .filters-panel .field {
    display: none;
  }

  .filters-panel .field:first-of-type {
    display: grid;
  }

  .filters-panel .field:first-of-type span {
    display: none;
  }

  .filters-panel input[type="search"] {
    min-height: 52px;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
  }

  #clearFiltersButton {
    display: none;
  }

  .process-list-head {
    align-items: stretch;
  }

  .task-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .task-page-head h2 {
    font-size: 26px;
  }

  .task-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .task-card-side {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .process-row-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 17px 15px;
  }

  .process-row-status .status-stack {
    width: 100%;
    max-width: none;
  }

  .process-row-status .status-pill {
    width: 100%;
    max-width: none;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.22;
  }

  .process-row-actions {
    justify-self: stretch;
  }

  .process-row-actions .row-actions {
    justify-content: flex-start;
  }

  .process-doc-compact-item:nth-of-type(n) {
    display: inline-flex;
  }

  .dashboard-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .attention-row {
    grid-template-columns: 9px 1fr;
  }

  .attention-row button {
    grid-column: 2;
    justify-self: start;
  }

  .document-overview-legend {
    justify-content: space-between;
    gap: 8px;
  }

  .overview-secondary {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .overview-secondary span {
    padding: 0 16px;
  }

  .document-viewbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .process-viewbar {
    justify-content: flex-start;
  }

  .document-quick,
  .process-quick {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .document-process-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 17px 15px;
  }

  .document-row-count {
    grid-column: 1;
  }

  .document-row-pills {
    grid-column: 1 / 3;
    padding-top: 11px;
    border-top: 1px solid #eef0f3;
  }

  .document-open-button {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .document-type-list {
    padding: 4px 15px 15px;
  }

  .document-type-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 15px 0;
  }

  .history-modal {
    inset: 58px 0 0;
    z-index: 35;
    place-items: stretch;
    padding: 0;
    background: rgba(15, 23, 42, 0.42);
  }

  .history-modal-panel {
    width: 100vw;
    max-width: none;
    height: calc(100vh - 58px);
    height: calc(100dvh - 58px);
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 0;
  }

  .history-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 14px;
    background: var(--surface);
  }

  .history-modal-head > div {
    min-width: 0;
  }

  .history-modal-head h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  .history-modal-head small {
    font-size: 12px;
  }

  .history-modal-process-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    font-size: 14px;
    line-height: 1.45;
  }

  .history-meta-line {
    display: flex;
    min-width: 0;
  }

  .history-meta-line > span:not(.history-meta-sep) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .modal-close-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .history-modal-body {
    padding: 16px;
  }

  .billing-summary-cards {
    grid-template-columns: 1fr;
  }

  .billing-installment-item {
    grid-template-columns: 1fr;
  }

  .billing-installment-item span {
    justify-self: start;
  }

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

  .history-form-row,
  .billing-generator,
  .billing-form-row,
  .history-entry {
    grid-template-columns: 1fr;
  }

  .process-file-item {
    align-items: center;
    max-width: 100%;
  }

  .bar-row {
    grid-template-columns: 1fr 42px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  h1 {
    font-size: 25px;
  }
}

/* === Financeiro unificado === */
body.finance-body {
    --app-bg: #f6f8fb;
    --bg: var(--app-bg);
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --muted: var(--text-muted);
    --border: #d7dee8;
    --border-strong: #cbd5e1;
    --primary: #047857;
    --primary-hover: #065f46;
    --primary-dark: var(--primary-hover);
    --primary-accent: #10b981;
    --primary-soft: #d1fae5;
    --success: #15803d;
    --success-soft: #dcfce7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --info: #2563eb;
    --info-soft: #dbeafe;
    --expense: #dc2626;
    --income: #2563eb;
    --violet: #6366f1;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius: var(--radius-md);
    --bottom-nav-height: 76px;
}

body.finance-body * {
    box-sizing: border-box;
}

body.finance-body {
    min-height: 100%;
}

body.finance-body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--app-font-family);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    color: var(--text);
    background: var(--bg);
}

body.finance-body a {
    color: inherit;
    text-decoration: none;
}

body.finance-body button,
body.finance-body input,
body.finance-body select,
body.finance-body textarea {
    font: inherit;
    letter-spacing: 0;
}

body.finance-body :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--info);
    outline-offset: 2px;
}

body.finance-body :where(button, input, select, textarea):disabled,
body.finance-body .button:disabled,
body.finance-body .icon-button:disabled,
body.finance-body .is-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

body.finance-body button {
    cursor: pointer;
}

body.finance-body .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

body.finance-body .auth-brand strong {
    font-size: 14px;
    font-weight: 700;
}

body.finance-body .auth-brand small,
body.finance-body .topbar-user small,
body.finance-body .panel-head p,
body.finance-body .stat-card small,
body.finance-body .budget-item small,
body.finance-body .account-card small,
body.finance-body .page-heading p,
body.finance-body .topbar-kicker {
    color: var(--muted);
}

/* Sidebar unica da area interna: portal administrativo + paginas do usuario. */
.app-shell.admin-layout .unified-sidebar {
    gap: 10px;
    border-right-color: rgba(255, 255, 255, 0.08);
    background: var(--user-sidebar-bg);
    color: var(--user-sidebar-text);
}

.app-shell.admin-layout .unified-brand {
    min-width: 0;
    padding: 0;
    border-bottom: 0;
}

.app-shell.admin-layout .unified-sidebar .brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-shell.admin-layout .unified-sidebar .brand-copy strong {
    color: #fff;
    font-size: 17px;
    line-height: 1.12;
}

.app-shell.admin-layout .unified-sidebar .brand-copy small {
    color: var(--user-sidebar-muted);
}

.app-shell.admin-layout .unified-sidebar .portal-brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(185, 148, 90, 0.72);
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
}

.app-shell.admin-layout .unified-sidebar .portal-brand-mark img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.app-shell.admin-layout .unified-admin-nav {
    display: grid;
    gap: 5px;
    margin-top: 22px;
    min-height: 0;
    max-height: calc(100vh - 212px);
    overflow-y: auto;
    padding: 2px 4px 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.app-shell.admin-layout .unified-nav-group {
    display: grid;
    gap: 5px;
    padding: 8px 0 8px 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.app-shell.admin-layout .unified-nav-children {
    display: grid;
    gap: 5px;
}

.app-shell.admin-layout .unified-nav-link {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b9c2d0;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.app-shell.admin-layout button.unified-nav-link {
    appearance: none;
}

.app-shell.admin-layout .unified-nav-parent {
    padding-right: 28px;
}

.app-shell.admin-layout .unified-nav-parent::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.62;
    transform: rotate(45deg);
    transition: transform 160ms ease, opacity 160ms ease;
}

.app-shell.admin-layout .unified-nav-group.is-open .unified-nav-parent::after {
    opacity: 0.9;
    transform: rotate(225deg);
}

.app-shell.admin-layout .unified-nav-child {
    margin-left: 6px;
}

.app-shell.admin-layout .unified-nav-group:not(.is-open) .unified-nav-children .unified-nav-link {
    display: none;
}

.app-shell.admin-layout .unified-nav-group:not(.is-open) .unified-nav-children .unified-nav-link.is-always-visible {
    display: flex;
}

.app-shell.admin-layout .unified-nav-link:hover,
.app-shell.admin-layout .unified-nav-link.active,
.app-shell.admin-layout .unified-nav-link.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-shell.admin-layout .unified-nav-group.has-active-child > .unified-nav-parent {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-shell.admin-layout .unified-nav-link.active::before,
.app-shell.admin-layout .unified-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--user-sidebar-accent);
}

.app-shell.admin-layout .unified-nav-link.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.app-shell.admin-layout .unified-nav-code {
    flex: 0 0 44px;
    color: var(--user-sidebar-accent);
    font-size: 11px;
    font-weight: 800;
}

.app-shell.admin-layout .unified-nav-copy,
.app-shell.admin-layout .unified-nav-label {
    min-width: 0;
}

.app-shell.admin-layout .unified-nav-copy {
    display: grid;
    gap: 1px;
}

.app-shell.admin-layout .unified-nav-copy strong {
    color: inherit;
    font-size: 12px;
    line-height: 1.15;
}

.app-shell.admin-layout .unified-nav-copy small {
    color: var(--user-sidebar-dim);
    font-size: 10px;
    line-height: 1.15;
}

.app-shell.admin-layout .unified-nav-link:hover .unified-nav-copy small,
.app-shell.admin-layout .unified-nav-link.active .unified-nav-copy small,
.app-shell.admin-layout .unified-nav-link.is-active .unified-nav-copy small {
    color: #cbd5e1;
}

.app-shell.admin-layout .unified-sidebar .sidebar-version {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding: 8px 9px 2px;
    color: var(--user-sidebar-dim);
    font-size: 11px;
}

.app-shell.admin-layout .unified-sidebar .sidebar-version strong {
    color: #d8e0ed;
    font-size: 13px;
}

.app-shell.admin-layout .sidebar-footer-action {
    flex: 0 0 auto;
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d8e0ed;
}

.app-shell.admin-layout .sidebar-footer-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-admin-nav {
    overflow: hidden;
    padding-right: 0;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-nav-group {
    border-left: 0;
    padding-left: 0;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-nav-link {
    justify-content: center;
    min-width: 50px;
    padding-left: 8px;
    padding-right: 8px;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-nav-parent::after {
    display: none;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-nav-child {
    margin-left: 0;
}

.app-shell.admin-layout:is(.sidebar-closed, .sidebar-auto:not(.sidebar-hover)) .unified-nav-code {
    flex-basis: auto;
}

@media (max-width: 760px) {
    .app-shell.admin-layout .unified-admin-nav {
        gap: 10px;
        margin: 0;
        max-height: min(62vh, 520px);
        overflow-y: auto;
        padding: 0;
    }

    .app-shell.admin-layout .unified-nav-group {
        gap: 7px;
        padding: 8px 0 8px 8px;
    }

    .app-shell.admin-layout .unified-nav-link,
    .app-shell.admin-layout .sidebar-footer-action {
        min-width: 0;
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 16px;
        background: rgba(23, 36, 58, 0.96);
        color: var(--user-sidebar-text);
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
        padding: 15px 16px;
        font-size: 16px;
        font-weight: 750;
    }

    .app-shell.admin-layout .unified-nav-link.active,
    .app-shell.admin-layout .unified-nav-link.is-active {
        background: #2b3a50;
        color: #fff;
    }

    .app-shell.admin-layout .unified-nav-link.active::before,
    .app-shell.admin-layout .unified-nav-link.is-active::before {
        left: -18px;
        height: 26px;
        background: var(--user-sidebar-accent);
    }
}

body.finance-body .app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.finance-body .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-start;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(246, 248, 251, 0.9);
    backdrop-filter: blur(14px);
}

body.finance-body .topbar-title {
    display: grid;
    gap: 2px;
    min-width: 0;
    color: var(--muted);
}

body.finance-body .topbar-title strong {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

body.finance-body .topbar-kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

body.finance-body .topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

body.finance-body .quick-action {
    position: relative;
}

body.finance-body .topbar-primary-action {
    min-height: 42px;
    padding: 9px 16px;
}

body.finance-body .topbar .button {
    width: auto;
}

body.finance-body .action-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 250px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

body.finance-body .quick-action.is-open .action-menu {
    display: grid;
    gap: 2px;
}

body.finance-body .action-menu button,
body.finance-body .action-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

body.finance-body .action-menu button:hover,
body.finance-body .action-menu a:hover {
    background: var(--surface-muted);
}

body.finance-body .topbar-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

body.finance-body .topbar-actions + .topbar-user {
    margin-left: 0;
}

body.finance-body .topbar-user-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

body.finance-body .topbar-user-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    max-width: min(360px, 36vw);
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

body.finance-body .topbar-user-button:hover {
    border-color: var(--border-strong);
    background: #fbfdff;
}

body.finance-body .user-menu {
    min-width: 220px;
}

body.finance-body .topbar-user-copy strong,
body.finance-body .topbar-user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.finance-body .avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

body.finance-body .avatar-image {
    overflow: hidden;
    padding: 0;
}

body.finance-body .avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.finance-body .avatar-preview {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    font-size: 15px;
}

body.finance-body .profile-photo-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

body.finance-body .profile-photo-row label {
    flex: 1 1 auto;
}

body.finance-body .content {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 24px;
}

body.finance-body .page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

body.finance-body .page-heading h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.15;
}

body.finance-body .page-heading p {
    margin: 6px 0 0;
}

body.finance-body .eyebrow {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

body.finance-body .page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.finance-body .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

body.finance-body .stat-card,
body.finance-body .panel,
body.finance-body .auth-card,
body.finance-body .account-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

body.finance-body .stat-card {
    display: grid;
    gap: 10px;
    min-height: 132px;
    padding: 16px;
}

body.finance-body .stat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

body.finance-body .stat-card strong {
    font-size: clamp(21px, 2.2vw, 30px);
    line-height: 1.1;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

body.finance-body .account-balance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

body.finance-body .account-balance-grid .stat-card {
    min-height: 118px;
}

body.finance-body .account-balance-grid .stat-card strong {
    font-size: clamp(19px, 1.7vw, 25px);
}

body.finance-body .stat-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

body.finance-body .tone-danger .stat-icon {
    color: #b91c1c;
    background: var(--danger-soft);
}

body.finance-body .tone-warning .stat-icon {
    color: #92400e;
    background: var(--warning-soft);
}

body.finance-body .tone-neutral .stat-icon {
    color: #334155;
    background: var(--surface-muted);
}

body.finance-body .grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

body.finance-body .span-4 {
    grid-column: span 4;
}

body.finance-body .span-5 {
    grid-column: span 5;
}

body.finance-body .span-6 {
    grid-column: span 6;
}

body.finance-body .span-7 {
    grid-column: span 7;
}

body.finance-body .span-8 {
    grid-column: span 8;
}

body.finance-body .panel {
    min-width: 0;
    padding: 16px;
}

body.finance-body .panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

body.finance-body .panel-head-wrap {
    align-items: center;
    flex-wrap: wrap;
}

body.finance-body .panel-head h3 {
    margin: 0;
    font-size: 16px;
}

body.finance-body .panel-head p {
    margin: 4px 0 0;
    font-size: 13px;
}

body.finance-body .panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1 1 680px;
    flex-wrap: wrap;
}

body.finance-body .panel-actions .table-filter {
    flex: 1 1 560px;
    justify-content: flex-end;
}

body.finance-body .button,
body.finance-body .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 700;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

body.finance-body .button {
    min-height: 38px;
    padding: 8px 12px;
    white-space: nowrap;
}

body.finance-body .button:hover,
body.finance-body .icon-button:hover {
    transform: translateY(-1px);
}

body.finance-body .button-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

body.finance-body .button-primary:hover {
    background: var(--primary-dark);
}

body.finance-body .button:active,
body.finance-body .icon-button:active {
    transform: translateY(0);
}

body.finance-body .button.is-loading,
body.finance-body .icon-button.is-loading,
body.finance-body [aria-busy="true"] {
    cursor: progress;
}

body.finance-body .button-ghost {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

body.finance-body .button-ghost:hover {
    background: var(--surface-muted);
}

body.finance-body .button-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

body.finance-body .button-full {
    width: 100%;
}

body.finance-body .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 18px 24px;
    background: rgba(15, 23, 42, 0.46);
    overflow-y: auto;
}

body.finance-body .modal-backdrop.is-open {
    display: flex;
}

body.finance-body .app-modal {
    width: min(100%, 560px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

body.finance-body .modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    background: #fbfdff;
}

body.finance-body .modal-head h3 {
    margin: 0;
    font-size: 18px;
}

body.finance-body .modal-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

body.finance-body .modal-cancel-link {
    margin: 10px 18px 18px;
}

body.finance-body.modal-open {
    overflow: hidden;
}

body.finance-body .hidden-form {
    display: none;
}

body.finance-body .icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

body.finance-body .icon-button.danger {
    color: #b91c1c;
}

body.finance-body .mobile-menu,
body.finance-body .mobile-bottom-nav,
body.finance-body .mobile-fab {
    display: none;
}

body.finance-body .mobile-bottom-item {
    min-width: 0;
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: 3px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

body.finance-body .mobile-bottom-item .icon {
    width: 20px;
    height: 20px;
}

body.finance-body .mobile-bottom-item.is-active {
    color: var(--primary-hover);
}

@media (max-width: 900px) {
    body.finance-body .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 25;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
    }

    body.finance-body .mobile-fab {
        position: fixed;
        right: 18px;
        bottom: calc(var(--bottom-nav-height) + 14px + env(safe-area-inset-bottom));
        z-index: 26;
        display: inline-grid;
        place-items: center;
        width: 54px;
        height: 54px;
        border-radius: 999px;
        color: #fff;
        background: var(--primary);
        box-shadow: 0 16px 30px rgba(4, 120, 87, 0.26);
    }
}

body.finance-body .inline-filter,
body.finance-body .table-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.finance-body .dashboard-period-filter {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body.finance-body .dashboard-period-dropdown {
    width: min(100%, 190px);
}

body.finance-body .dashboard-period-toggle {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
}

body.finance-body .dashboard-period-toggle span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}

body.finance-body .dashboard-period-toggle .icon:last-child {
    flex: 0 0 auto;
}

body.finance-body .dashboard-period-menu {
    width: min(92vw, 190px);
    padding: 8px;
    gap: 8px;
}

body.finance-body .dashboard-period-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

body.finance-body .dashboard-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

body.finance-body .dashboard-month-grid button {
    justify-content: center;
    min-height: 32px;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface);
    font-weight: 800;
    text-align: center;
}

body.finance-body .dashboard-month-grid button:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .dashboard-month-grid button.is-active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

body.finance-body .dashboard-month-grid.is-muted button:not(.is-active) {
    color: var(--muted);
    background: var(--surface-muted);
}

body.finance-body .report-filter {
    align-items: stretch;
}

body.finance-body .report-filter > select,
body.finance-body .report-filter > input[type="search"] {
    width: auto;
    min-width: 180px;
}

body.finance-body .report-filter > input[type="search"] {
    flex: 1 1 180px;
}

body.finance-body .report-date-range {
    display: inline-grid;
    grid-template-columns: minmax(142px, 1fr) auto minmax(142px, 1fr);
    align-items: stretch;
    min-height: 38px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

body.finance-body .report-date-range input {
    min-height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #475569;
    font-weight: 700;
    text-align: center;
}

body.finance-body .report-date-range input:focus {
    box-shadow: inset 0 0 0 2px rgba(4, 120, 87, 0.18);
}

body.finance-body .report-date-range-divider {
    display: grid;
    min-width: 42px;
    place-items: center;
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-muted);
    font-weight: 700;
}

body.finance-body input,
body.finance-body select,
body.finance-body textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--text);
    background: var(--surface);
    outline: none;
}

body.finance-body .modal-backdrop .app-form,
body.finance-body .modal-backdrop .empty-state,
body.finance-body .modal-backdrop .statement-ignore-form {
    margin: 0;
    padding: 18px;
}

body.finance-body textarea {
    min-height: 82px;
    resize: vertical;
}

body.finance-body input:focus,
body.finance-body select:focus,
body.finance-body textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.14);
}

body.finance-body input[type="color"] {
    min-height: 38px;
    padding: 4px;
}

body.finance-body .stacked-form {
    display: grid;
    gap: 12px;
}

body.finance-body .stacked-form label,
body.finance-body .budget-row label {
    display: grid;
    gap: 6px;
}

body.finance-body .stacked-form label > span:first-child,
body.finance-body .budget-row label > span:first-child {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

body.finance-body .app-form {
    margin-top: 6px;
}

body.finance-body .form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.finance-body .switch-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

body.finance-body .switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.finance-body .switch-control {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    transition: background 0.18s ease;
}

body.finance-body .switch-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.18s ease;
}

body.finance-body .switch-row input:checked + .switch-control {
    background: var(--primary);
}

body.finance-body .switch-row input:checked + .switch-control::after {
    transform: translateX(18px);
}

body.finance-body .switch-row input:focus-visible + .switch-control {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

body.finance-body .permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.finance-body .permission-switch {
    width: 100%;
}

body.finance-body .sidebar-preference-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

body.finance-body .sidebar-preference-row {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

body.finance-body .user-access-list {
    display: grid;
    gap: 12px;
}

body.finance-body .user-access-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

body.finance-body .user-access-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.finance-body .user-access-head > div {
    display: grid;
    gap: 2px;
}

body.finance-body .user-access-head small,
body.finance-body .muted-note {
    color: var(--muted);
}

body.finance-body .muted-note {
    margin: 0;
    font-size: 13px;
}

body.finance-body .button.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff;
}

body.finance-body .form-section-separator {
    height: 1px;
    margin: 22px 0 16px;
    background: var(--border);
}

body.finance-body .form-subhead {
    margin-bottom: 12px;
}

body.finance-body .form-subhead h4 {
    margin: 0;
    font-size: 15px;
}

body.finance-body .form-subhead p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

body.finance-body .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

body.finance-body .segmented label {
    display: block;
}

body.finance-body .segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.finance-body .segmented span {
    display: grid;
    place-items: center;
    min-height: 32px;
    border-radius: calc(var(--radius) - 2px);
    color: var(--muted);
    font-weight: 800;
}

body.finance-body .segmented input:checked + span {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.finance-body .input-with-icon {
    position: relative;
    display: block;
}

body.finance-body .input-with-icon .icon {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transform: translateY(-50%);
}

body.finance-body .input-with-icon input {
    padding-left: 36px;
}

body.finance-body .table-wrap {
    width: 100%;
    overflow-x: auto;
}

body.finance-body table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

body.finance-body .table-wrap {
    position: relative;
}

body.finance-body .table-wrap::after {
    content: "";
    position: sticky;
    right: 0;
    display: block;
    width: 1px;
    height: 1px;
    box-shadow: -18px 0 22px rgba(15, 23, 42, 0.08);
}

body.finance-body th,
body.finance-body td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

body.finance-body th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

body.finance-body thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

body.finance-body tbody tr:focus-within {
    background: #f8fafc;
    box-shadow: inset 3px 0 0 var(--info);
}

body.finance-body tbody tr:hover {
    background: #fbfdff;
}

body.finance-body .align-right {
    text-align: right;
}

body.finance-body .align-end {
    justify-content: flex-end;
}

body.finance-body .strong {
    font-weight: 700;
}

body.finance-body .table-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

body.finance-body .table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.finance-body .table-actions form {
    display: inline-flex;
}

body.finance-body .text-success {
    color: #047857;
}

body.finance-body .text-danger {
    color: #dc2626;
}

body.finance-body .align-right,
body.finance-body .strong,
body.finance-body .stat-card strong,
body.finance-body .account-card > strong,
body.finance-body .money-cell,
body.finance-body .wishlist-amount,
body.finance-body .reconcile-row b,
body.finance-body .definition-grid dd,
body.finance-body .bill-actions strong,
body.finance-body .legend-list strong {
    font-variant-numeric: tabular-nums;
}

body.finance-body .badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}


body.finance-body .type-badge {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
}

body.finance-body .table-wrap td.align-right.strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body.finance-body .pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

body.finance-body .pagination-bar > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

body.finance-body .pagination-controls,
body.finance-body .per-page-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.finance-body .pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.finance-body .pagination a,
body.finance-body .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #475569;
    background: var(--surface);
    font-size: 13px;
    font-weight: 800;
}

body.finance-body .pagination a:hover {
    border-color: var(--primary);
    color: var(--text);
    background: var(--primary-soft);
}

body.finance-body .pagination .active span {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

body.finance-body .pagination .disabled span {
    color: #94a3b8;
    background: var(--surface-muted);
    cursor: not-allowed;
}

body.finance-body .per-page-form {
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

body.finance-body .per-page-form select {
    width: 78px;
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
}

body.finance-body .per-page-form span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

body.finance-body .badge-success {
    color: var(--success);
    background: var(--success-soft);
}

body.finance-body .badge-danger {
    color: #b91c1c;
    background: var(--danger-soft);
}

body.finance-body .badge-soft {
    color: #334155;
    background: var(--surface-muted);
}

body.finance-body .color-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--dot, var(--primary));
}

body.finance-body .chart-wrap {
    position: relative;
    width: 100%;
}

body.finance-body .chart-large {
    height: 340px;
}

body.finance-body .chart-donut {
    height: 250px;
}

body.finance-body .chart-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

body.finance-body .legend-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

body.finance-body .legend-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

body.finance-body .legend-list strong {
    white-space: nowrap;
}

body.finance-body .overdue-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

body.finance-body .overdue-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fbfdff;
}

body.finance-body .overdue-summary-item span,
body.finance-body .overdue-table small {
    color: var(--muted);
}

body.finance-body .overdue-summary-item span {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

body.finance-body .overdue-summary-item small,
body.finance-body .overdue-table small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

body.finance-body .overdue-summary-item strong {
    white-space: nowrap;
    font-size: 20px;
}

body.finance-body .overdue-summary-item.is-income strong {
    color: #047857;
}

body.finance-body .overdue-summary-item.is-expense strong {
    color: #dc2626;
}

body.finance-body .budget-list,
body.finance-body .category-list {
    display: grid;
    gap: 10px;
}

body.finance-body .budget-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .budget-item > div {
    min-width: 0;
}

body.finance-body .budget-item span:first-child,
body.finance-body .budget-item small {
    display: block;
}

body.finance-body .dashboard-wishlist-list {
    display: grid;
    gap: 10px;
}

body.finance-body .dashboard-wishlist-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .dashboard-wishlist-thumb,
body.finance-body .dashboard-wishlist-fallback {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
}

body.finance-body .dashboard-wishlist-thumb {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

body.finance-body .dashboard-wishlist-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.finance-body .dashboard-wishlist-main {
    min-width: 0;
}

body.finance-body .dashboard-wishlist-main strong,
body.finance-body .dashboard-wishlist-main small {
    display: block;
}

body.finance-body .dashboard-wishlist-main strong {
    overflow-wrap: anywhere;
}

body.finance-body .dashboard-wishlist-item > strong {
    white-space: nowrap;
}

body.finance-body .progress {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

body.finance-body .progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

body.finance-body .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 16px;
}

body.finance-body .account-card {
    display: grid;
    gap: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

body.finance-body .account-card > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.finance-body .account-card > strong {
    font-size: 22px;
    font-variant-numeric: tabular-nums;
}

body.finance-body .account-icon,
body.finance-body .category-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    color: var(--account-color, var(--category-color, var(--primary)));
    background: var(--primary-soft);
    background: color-mix(in srgb, var(--account-color, var(--category-color, var(--primary))) 14%, #fff);
}

body.finance-body .bank-logo {
    width: 42px;
    height: 42px;
    padding: 4px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--primary);
}

body.finance-body .account-icon.bank-logo,
body.finance-body .category-icon.bank-logo,
body.finance-body .stat-icon.bank-logo {
    width: 42px;
    height: 42px;
    padding: 4px;
    color: var(--primary);
    background: #fff;
}

body.finance-body .bank-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.finance-body .bank-logo-fallback {
    color: var(--primary-hover);
    background: var(--primary-soft);
}

body.finance-body .category-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .category-row strong {
    display: block;
    margin-bottom: 4px;
}

body.finance-body .wishlist-list {
    display: grid;
    gap: 10px;
}

body.finance-body .wishlist-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .wishlist-icon {
    --category-color: #f59e0b;
    width: 58px;
    height: 58px;
}

body.finance-body .dashboard-wishlist-fallback.wishlist-icon {
    width: 54px;
    height: 54px;
}

body.finance-body .wishlist-main {
    min-width: 0;
}

body.finance-body .wishlist-main strong {
    display: block;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

body.finance-body .wishlist-thumb {
    display: block;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

body.finance-body .wishlist-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.finance-body .wishlist-notes {
    display: block;
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.finance-body .wishlist-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.finance-body .wishlist-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #334155;
    background: var(--surface-muted);
    font-size: 12px;
    font-weight: 800;
}

body.finance-body .wishlist-links a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.finance-body .wishlist-links .icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

body.finance-body .wishlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

body.finance-body .wishlist-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--muted);
    background: #fbfdff;
    font-size: 12px;
    font-weight: 800;
}

body.finance-body .wishlist-amount {
    display: grid;
    justify-items: end;
    gap: 2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.finance-body .wishlist-amount small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

body.finance-body .budget-table {
    display: grid;
    gap: 10px;
}

body.finance-body .budget-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .budget-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.finance-body .budget-name small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

body.finance-body .budget-progress {
    display: grid;
    gap: 8px;
}

body.finance-body .empty-state {
    min-height: 170px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 22px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: #fbfdff;
}

body.finance-body .empty-state > span {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

body.finance-body .empty-state strong {
    color: var(--text);
}

body.finance-body .empty-state p {
    max-width: 320px;
    margin: 0;
}

body.finance-body .flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1200;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

body.finance-body .flash {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

body.finance-body .flash.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

body.finance-body .flash-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    color: var(--info);
    background: var(--info-soft);
}

body.finance-body .flash-icon .icon {
    width: 15px;
    height: 15px;
}

body.finance-body .flash-success .flash-icon {
    color: var(--success);
    background: var(--success-soft);
}

body.finance-body .flash-danger .flash-icon,
body.finance-body .flash-error .flash-icon {
    color: var(--danger);
    background: var(--danger-soft);
}

body.finance-body .flash-warning .flash-icon {
    color: var(--warning);
    background: var(--warning-soft);
}

body.finance-body .flash > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

body.finance-body .flash-close {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    body.finance-body .flash-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

body.finance-body .auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
        var(--bg);
    background-size: 32px 32px;
}

body.finance-body .auth-shell {
    width: min(100%, 460px);
}

body.finance-body .auth-card {
    padding: 22px;
    box-shadow: var(--shadow);
}

body.finance-body .install-card {
    width: min(100%, 520px);
}

body.finance-body .auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

body.finance-body .auth-copy h1,
body.finance-body .locked-state h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

body.finance-body .auth-copy p:not(.eyebrow),
body.finance-body .locked-state p,
body.finance-body .auth-footnote {
    color: var(--muted);
    line-height: 1.6;
}

body.finance-body .auth-footnote {
    margin: 18px 0 0;
    text-align: center;
}

body.finance-body .auth-footnote a {
    color: var(--primary-dark);
    font-weight: 800;
}

body.finance-body .locked-state {
    display: grid;
    gap: 12px;
    justify-items: start;
}

body.finance-body .locked-state > span {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

body.finance-body .error-box {
    width: 100%;
    max-height: 150px;
    overflow: auto;
    display: block;
    padding: 12px;
    border-radius: var(--radius);
    color: #b91c1c;
    background: var(--danger-soft);
    white-space: pre-wrap;
}

body.finance-body .span-12 {
    grid-column: 1 / -1;
}

body.finance-body .transaction-toolbar {
    margin: -4px 0 0;
}

body.finance-body .transaction-toolbar .report-tabs {
    margin: 0 0 14px;
}

body.finance-body .filter-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

body.finance-body .filter-panel .report-filter {
    flex: 1 1 760px;
    justify-content: flex-start;
}

body.finance-body .report-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 14px;
    border-bottom: 1px solid var(--border);
}

body.finance-body .report-tab {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border: 0;
    color: var(--muted);
    background: transparent;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 700;
}

body.finance-body .report-tab:hover,
body.finance-body .report-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--primary);
}

body.finance-body .monthly-report-panel {
    overflow: hidden;
}

body.finance-body .monthly-report-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

body.finance-body .monthly-report-table {
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

body.finance-body .monthly-report-table th,
body.finance-body .monthly-report-table td {
    padding: 9px 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

body.finance-body .monthly-report-table th:last-child,
body.finance-body .monthly-report-table td:last-child {
    border-right: 0;
}

body.finance-body .monthly-report-table thead th {
    color: #facc15;
    background: #111827;
    border-color: #1f2937;
    text-align: center;
}

body.finance-body .monthly-report-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 220px;
    max-width: 280px;
    color: var(--text);
    background: var(--surface);
    text-align: left;
}

body.finance-body .monthly-report-table thead .sticky-col {
    z-index: 4;
    color: #facc15;
    background: #111827;
}

body.finance-body .monthly-report-table tbody th.sticky-col {
    font-weight: 800;
}

body.finance-body .monthly-report-table .month-group {
    min-width: 132px;
    font-size: 12px;
}

body.finance-body .monthly-report-table .current-month {
    min-width: 360px;
}

body.finance-body .monthly-total-row th,
body.finance-body .monthly-total-row td,
body.finance-body .monthly-income-row th,
body.finance-body .monthly-income-row td,
body.finance-body .monthly-net-row th,
body.finance-body .monthly-net-row td {
    background: #f8fafc;
}

body.finance-body .monthly-total-row th,
body.finance-body .monthly-total-row td {
    font-weight: 700;
}

body.finance-body .monthly-section-row th {
    color: #facc15;
    background: #111827;
    border-color: #1f2937;
    text-align: left;
    text-transform: uppercase;
}

body.finance-body .monthly-category {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

body.finance-body .monthly-category .category-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
}

body.finance-body .money-cell {
    font-variant-numeric: tabular-nums;
}
@media (max-width: 1180px) {
    body.finance-body .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.finance-body .span-4,
    body.finance-body .span-5,
    body.finance-body .span-6,
    body.finance-body .span-7,
    body.finance-body .span-8 {
        grid-column: 1 / -1;
    }

    body.finance-body .budget-row {
        grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(160px, 1fr);
    }

    body.finance-body .budget-row .table-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 900px) {
    body.finance-body {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }

    body.finance-body .topbar {
        padding: 12px 16px;
    }

    body.finance-body .content {
        padding: 18px 16px;
    }

    body.finance-body .topbar-user-copy {
        display: none;
    }

    body.finance-body .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    body.finance-body .page-actions,
    body.finance-body .inline-filter,
    body.finance-body .table-filter {
        justify-content: flex-start;
    }

    body.finance-body .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body.finance-body .mobile-menu {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    body.finance-body {
        font-size: 14px;
    }

    body.finance-body .topbar {
        flex-wrap: wrap;
    }

    body.finance-body .topbar-actions {
        margin-left: auto;
    }

    body.finance-body .topbar .topbar-primary-action span {
        display: none;
    }

    body.finance-body .action-menu {
        left: 0;
        right: 0;
        min-width: 0;
    }

    body.finance-body .dashboard-period-menu {
        width: 100%;
    }

    body.finance-body .sidebar-preference-list {
        grid-template-columns: 1fr;
    }

    body.finance-body .report-filter,
    body.finance-body .report-filter > select,
    body.finance-body .report-filter > input[type="search"],
    body.finance-body .report-date-range {
        width: 100%;
    }

    body.finance-body .report-date-range {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    body.finance-body .transaction-toolbar .report-tabs {
        width: 100%;
        min-width: 0;
    }

    body.finance-body .stats-grid,
    body.finance-body .grid-12,
    body.finance-body .form-grid-2,
    body.finance-body .permission-grid,
    body.finance-body .overdue-summary {
        grid-template-columns: 1fr;
    }

    body.finance-body .dashboard-period-top {
        grid-template-columns: 1fr;
    }

    body.finance-body .dashboard-month-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.finance-body .cards-grid {
        grid-template-columns: 1fr;
    }

    body.finance-body .stat-card {
        min-height: 118px;
    }

    body.finance-body .page-heading h1 {
        font-size: 23px;
    }

    body.finance-body .button {
        width: 100%;
    }

    body.finance-body .topbar .button,
    body.finance-body .topbar .icon-button,
    body.finance-body .topbar-user .icon-button,
    body.finance-body .topbar-user-button {
        width: auto;
    }

    body.finance-body .inline-filter,
    body.finance-body .table-filter {
        width: 100%;
    }

    body.finance-body .inline-filter input,
    body.finance-body .table-filter input,
    body.finance-body .table-filter select {
        min-width: 0;
    }

    body.finance-body .budget-row {
        grid-template-columns: 1fr;
    }

    body.finance-body .category-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body.finance-body .dashboard-wishlist-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    body.finance-body .dashboard-wishlist-item > strong {
        grid-column: 2;
    }

    body.finance-body .wishlist-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    body.finance-body .wishlist-amount {
        grid-column: 2;
        justify-items: start;
    }

    body.finance-body .category-row .table-actions,
    body.finance-body .wishlist-row .table-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    body.finance-body .chart-large {
        height: 270px;
    }

    body.finance-body .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    body.finance-body .app-modal {
        width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top));
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        overflow-y: auto;
    }
}

body.finance-body .badge-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

body.finance-body .check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

body.finance-body .check-row input {
    width: auto;
    min-height: auto;
}

body.finance-body .bill-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
    align-items: start;
}

body.finance-body .bill-row small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

body.finance-body .bill-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
}

body.finance-body .bill-pay-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

body.finance-body .bill-pay-form select {
    width: 190px;
}

body.finance-body .bill-pay-form input[type="date"] {
    width: 142px;
}
body.finance-body .statement-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.finance-body .statement-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

body.finance-body .matched-statement-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

body.finance-body .statement-confirm-row td {
    background: #fbfdff;
}

body.finance-body .statement-confirm-form {
    display: grid;
    gap: 10px;
    margin-top: 0;
}

body.finance-body .statement-ignore-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

@media (max-width: 640px) {
    body.finance-body .statement-summary,
    body.finance-body .statement-ignore-form,
    body.finance-body .statement-confirm-form .table-actions {
        justify-content: stretch;
    }
}
body.finance-body .reconciliation-imports .category-row.is-selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .reconciliation-filter label {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

body.finance-body .reconciliation-filter label > span:first-child,
body.finance-body .reconciliation-pending-title small {
    color: var(--muted);
    font-size: 13px;
}

body.finance-body .reconciliation-pending-title {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

body.finance-body .reconciliation-table td {
    vertical-align: top;
}
body.finance-body .reconciliation-filter-panel {
    margin-bottom: 14px;
}

body.finance-body .reconciliation-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.finance-body .reconcile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 0.46fr);
    gap: 14px;
    align-items: start;
}

body.finance-body .reconciliation-pair-form {
    margin: 0;
}

body.finance-body .reconcile-panel,
body.finance-body .reconcile-summary {
    min-height: 420px;
}

body.finance-body .reconcile-list {
    display: grid;
    gap: 8px;
    max-height: 640px;
    overflow: auto;
    padding-right: 4px;
}

body.finance-body .reconcile-row-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: center;
}

body.finance-body .reconcile-row {
    display: grid;
    grid-template-columns: auto minmax(78px, 0.28fr) minmax(0, 1fr) minmax(110px, auto);
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

body.finance-body .reconcile-row:hover,
body.finance-body .reconcile-row:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .reconcile-row.is-suggested {
    border-color: #f59e0b;
    background: var(--warning-soft);
}

body.finance-body .reconcile-row input {
    width: auto;
    min-height: auto;
}

body.finance-body .reconcile-row strong {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.finance-body .reconcile-row b {
    justify-self: end;
    white-space: nowrap;
}

body.finance-body .reconcile-row em {
    grid-column: 2 / -1;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

body.finance-body .reconcile-row-delete {
    align-self: center;
}

body.finance-body .definition-grid {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    gap: 10px 12px;
    margin: 0 0 14px;
}

body.finance-body .definition-grid dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

body.finance-body .definition-grid dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
    overflow-wrap: anywhere;
}

body.finance-body .pre-registration-list {
    display: grid;
    gap: 12px;
}

body.finance-body .pre-registration-item {
    display: grid;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fbfdff;
}

body.finance-body .pre-registration-summary {
    display: grid;
    align-content: start;
    gap: 8px;
}

body.finance-body .pre-registration-summary strong {
    overflow-wrap: anywhere;
}

body.finance-body .pre-registration-summary small {
    color: var(--muted);
}

body.finance-body .pre-registration-summary b {
    font-size: 18px;
}

@media (max-width: 1180px) {
    body.finance-body .reconcile-layout,
    body.finance-body .pre-registration-item {
        grid-template-columns: 1fr;
    }

    body.finance-body .reconcile-panel,
    body.finance-body .reconcile-summary {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    body.finance-body .reconciliation-kpis {
        grid-template-columns: 1fr;
    }

    body.finance-body .reconcile-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body.finance-body .reconcile-row b {
        justify-self: start;
    }

    body.finance-body .reconcile-row em {
        grid-column: 1 / -1;
    }
}body.finance-body .reconcile-row-static {
    cursor: default;
}

body.finance-body .reconcile-row-action {
    grid-column: 1 / -1;
    justify-self: end;
    margin: 0;
}

body.finance-body .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.finance-body .dashboard-stats-grid {
    grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(180px, 1fr));
}

body.finance-body .dashboard-stats-grid .stat-card:first-child {
    min-height: 154px;
    background:
        linear-gradient(135deg, rgba(4, 120, 87, 0.08), rgba(37, 99, 235, 0.05)),
        var(--surface);
}

body.finance-body .dashboard-priority-grid {
    align-items: stretch;
}

body.finance-body .chart-legend {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

body.finance-body .chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.finance-body .chart-legend span::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--primary);
}

body.finance-body .chart-legend .is-income::before {
    background: var(--income);
}

body.finance-body .chart-legend .is-expense::before {
    background: var(--expense);
}

body.finance-body .chart-legend .is-net::before {
    width: 16px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

body.finance-body .chart-period-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 112px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #334155;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

body.finance-body .chart-period-pill .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

body.finance-body .chart-tooltip {
    position: absolute;
    z-index: 3;
    display: grid;
    gap: 7px;
    min-width: 164px;
    padding: 12px;
    border: 1px solid #d8e2ef;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13);
    color: var(--text);
    font-size: 12px;
    pointer-events: none;
    transform: translate(-50%, -100%);
}

body.finance-body .chart-tooltip strong {
    font-size: 13px;
}

body.finance-body .chart-tooltip span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

body.finance-body .chart-tooltip span b {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body.finance-body .dashboard-priority-grid > .panel.span-8 {
    padding: 24px 28px 18px;
    border-radius: var(--radius-lg);
}

body.finance-body .compact-list {
    display: grid;
    gap: 8px;
}

body.finance-body .compact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

body.finance-body .compact-list-item:first-child {
    border-top: 0;
}

body.finance-body .compact-list-item strong,
body.finance-body .compact-list-item small {
    display: block;
}

body.finance-body .compact-list-item small {
    margin-top: 3px;
    color: var(--muted);
}

body.finance-body .compact-list-item b {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.finance-body .bank-account-mini {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fbfdff;
}

body.finance-body .bank-account-mini strong,
body.finance-body .bank-account-mini small {
    display: block;
}

body.finance-body .bank-account-mini small {
    color: var(--muted);
}

body.finance-body .bank-account-mini b {
    justify-self: end;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.finance-body .modern-account-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    min-height: 132px;
    padding: 18px 14px 14px 16px;
    gap: 10px 14px;
    border-color: #dfe5ee;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.035);
}

body.finance-body .account-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body.finance-body .account-card-logo {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    flex: 0 0 auto;
}

body.finance-body .account-card-logo.bank-logo {
    padding: 0;
    border: 0;
    background: transparent;
}

body.finance-body .account-card-logo:not(.bank-logo) {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
        var(--account-color, var(--primary));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

body.finance-body .account-card-logo:not(.bank-logo) .icon {
    width: 26px;
    height: 26px;
}

body.finance-body .account-card-title {
    min-width: 0;
}

body.finance-body .account-card-title strong,
body.finance-body .account-card-title small {
    display: block;
}

body.finance-body .account-card-title strong {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

body.finance-body .account-card-title small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

body.finance-body .account-card-title span {
    display: block;
    margin-top: 10px;
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

body.finance-body .account-balance-block {
    display: grid;
    align-self: end;
    justify-items: end;
    gap: 8px;
    padding-top: 46px;
}

body.finance-body .account-balance-block span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    white-space: nowrap;
}

body.finance-body .account-balance-block strong {
    font-size: 14px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.finance-body .account-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.finance-body .account-card-meta span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    color: #334155;
    background: var(--surface-muted);
    font-size: 12px;
    font-weight: 700;
}

body.finance-body .account-card-menu {
    justify-self: end;
}

body.finance-body .account-menu-button {
    width: 32px;
    height: 32px;
    border-color: transparent;
    background: transparent;
    color: #0f172a;
}

body.finance-body .account-menu-button:hover {
    background: var(--surface-muted);
}

body.finance-body .balance-adjustment-panel {
    background: linear-gradient(180deg, #fff, #fbfdff);
}

body.finance-body .balance-adjustment-panel > .panel-head {
    margin-bottom: 8px;
}

body.finance-body .selected-bank-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fbfdff;
}

body.finance-body .selected-bank-card strong,
body.finance-body .selected-bank-card small {
    display: block;
}

body.finance-body .selected-bank-card small {
    color: var(--muted);
}

body.finance-body .file-dropzone {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 190px;
    padding: 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    background: #fbfdff;
    text-align: center;
    cursor: pointer;
}

body.finance-body .file-dropzone.is-dragging,
body.finance-body .file-dropzone:focus-within {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .file-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

body.finance-body .file-dropzone strong {
    color: var(--text);
    font-size: 15px;
}

body.finance-body .file-dropzone em {
    max-width: 100%;
    color: var(--text);
    font-size: 12px;
    font-style: normal;
    overflow-wrap: anywhere;
}

body.finance-body .file-dropzone-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .bank-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body.finance-body .bank-logo-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

body.finance-body .reconciliation-filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

body.finance-body .reconciliation-filter {
    align-items: stretch;
}

body.finance-body .reconciliation-tabs,
body.finance-body .import-tabs {
    overflow-x: auto;
}

body.finance-body .reconcile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.finance-body .reconcile-summary {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 8;
    grid-column: 1 / -1;
    min-height: auto;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
}

body.finance-body .reconcile-summary .definition-grid {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    align-items: end;
}

body.finance-body .reconcile-summary .definition-grid dt {
    grid-row: 1;
}

body.finance-body .reconcile-summary .definition-grid dd {
    grid-row: 2;
    text-align: left;
}

body.finance-body .reconcile-row {
    min-height: 76px;
}

body.finance-body .reconcile-row.is-selected,
body.finance-body .reconcile-row:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}

body.finance-body .reconcile-row.is-suggested {
    border-color: var(--warning);
    background: linear-gradient(0deg, var(--warning-soft), var(--warning-soft));
}

body.finance-body .reconcile-row.is-suggested.is-selected,
body.finance-body .reconcile-row.is-suggested:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.finance-body .reconcile-row em {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

body.finance-body .reconcile-row em small {
    flex-basis: 100%;
    color: var(--muted);
}

body.finance-body .reconcile-mobile-steps {
    display: none;
}

body.finance-body .confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 18px 18px;
}

body.finance-body .monthly-report-table thead th,
body.finance-body .monthly-report-table thead .sticky-col,
body.finance-body .monthly-section-row th {
    color: #e2e8f0;
    background: #0f172a;
    border-color: #1e293b;
}

body.finance-body .monthly-report-table .current-month {
    color: #ecfdf5;
    background: var(--primary);
}

body.finance-body .monthly-total-row th,
body.finance-body .monthly-total-row td {
    font-weight: 700;
}

@media (max-width: 1180px) {
    body.finance-body .dashboard-stats-grid,
    body.finance-body .reconciliation-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.finance-body .dashboard-stats-grid .stat-card:first-child,
    body.finance-body .reconciliation-filter-panel .reconciliation-filter {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    body.finance-body .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    body.finance-body .account-balance-grid {
        grid-template-columns: 1fr;
    }

    body.finance-body .bank-account-mini {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body.finance-body .bank-account-mini b {
        grid-column: 2;
        justify-self: start;
    }

    body.finance-body .reconciliation-filter-panel {
        grid-template-columns: 1fr;
    }

    body.finance-body .reconcile-mobile-steps {
        position: sticky;
        top: 64px;
        z-index: 9;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 12px;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
    }

    body.finance-body .reconcile-mobile-steps button {
        min-height: 40px;
        border: 0;
        border-radius: var(--radius-md);
        color: var(--muted);
        background: transparent;
        font-weight: 700;
    }

    body.finance-body .reconcile-mobile-steps button.is-active {
        color: var(--primary-hover);
        background: var(--primary-soft);
    }

    body.finance-body .reconcile-layout {
        display: block;
    }

    body.finance-body .reconcile-panel,
    body.finance-body .reconcile-summary {
        display: none;
        margin-bottom: 12px;
    }

    body.finance-body .reconcile-panel.is-mobile-active,
    body.finance-body .reconcile-summary.is-mobile-active {
        display: block;
    }

    body.finance-body .reconcile-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    body.finance-body .reconcile-summary {
        position: sticky;
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }

    body.finance-body .reconcile-summary .definition-grid {
        grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
    }

    body.finance-body .reconcile-summary .definition-grid dt,
    body.finance-body .reconcile-summary .definition-grid dd {
        grid-row: auto;
    }

    body.finance-body .reconcile-summary .definition-grid dd {
        text-align: right;
    }

    body.finance-body table:not(.monthly-report-table):not(.matched-statement-table) {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    body.finance-body .modern-account-card {
        min-height: auto;
    }

    body.finance-body .account-card-link {
        justify-self: stretch;
    }

    body.finance-body .confirm-actions {
        flex-direction: column-reverse;
    }

    body.finance-body .confirm-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.finance-body *,
    body.finance-body *::before,
    body.finance-body *::after {
        scroll-behavior: auto;
        transition-duration: 0.001ms;
        animation-duration: 0.001ms;
        animation-iteration-count: 1;
    }
}
/* === Fim Financeiro unificado === */
