:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #eef1f7;
  --bg-soft: #e7ebf3;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f8fafc;
  --field: #f8fafc;
  --text: #101828;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: rgba(15, 23, 42, 0.07);
  --nav: #131c2e;
  --nav-deep: #060a14;
  --brand: #2f6fed;
  --brand-strong: #1d4ed8;
  --cyan: #0d9488;
  --accent: #d97706;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #b45309;
  --shadow: 0 24px 48px rgba(15, 23, 42, 0.10);
  --soft-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  background: var(--bg);
}

body.app-body::before {
  content: none;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-deep) 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  color: #eef2f8;
  padding: 18px 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 22px;
  min-height: 42px;
  padding: 0 4px;
  text-decoration: none;
}

.brand-text {
  display: none;
}

.brand-mark {
  background: linear-gradient(145deg, var(--brand), #4f8bff);
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(47, 111, 237, 0.35);
  color: #ffffff;
  display: grid;
  font-weight: 800;
  height: 38px;
  place-items: center;
  width: 38px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #ffffff;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand small {
  color: #7c8aa5;
  font-size: 11px;
  margin-top: 1px;
}

.nav-menu {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-title {
  display: none;
}

.nav-group + .nav-group {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 6px;
  padding-top: 10px;
}

.sidebar a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b9c3d6;
  display: flex;
  font-size: 13px;
  font-weight: 650;
  gap: 10px;
  justify-content: center;
  min-height: 40px;
  padding: 9px;
  position: relative;
  text-decoration: none;
}

.nav-icon {
  color: #ffffff;
  fill: none;
  flex: 0 0 20px;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  width: 20px;
}

.sidebar a:hover {
  background: rgba(111, 161, 255, 0.16);
  color: #ffffff;
}

.sidebar a:hover .nav-icon {
  color: #ffffff;
}

.sidebar a.active {
  background: linear-gradient(90deg, rgba(47, 111, 237, 0.34), rgba(47, 111, 237, 0.12));
  color: #ffffff;
}

.sidebar a.active .nav-icon {
  color: #ffffff;
}

.nav-label {
  background: #0b1220;
  border: 1px solid rgba(111, 161, 255, 0.3);
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  color: #eef2f8;
  font-size: 12px;
  font-weight: 700;
  left: calc(100% + 10px);
  opacity: 0;
  padding: 6px 10px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
  z-index: 60;
}

.sidebar a:hover .nav-label,
.sidebar a:focus-visible .nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.content {
  min-width: 0;
  padding: 22px 26px;
  position: relative;
}

.topbar {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px 18px;
  position: sticky;
  top: 14px;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.topbar-heading {
  min-width: 220px;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

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

h1 {
  color: #0b1220;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  color: #16202f;
  font-size: 16px;
  font-weight: 750;
}

.topbar-date,
.user-chip,
.quick-link {
  background: #f4f6fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 11px;
  white-space: nowrap;
}

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

.topbar-actions select {
  min-width: 190px;
}

.quick-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-link {
  color: var(--brand-strong);
  text-decoration: none;
}

.quick-link:hover {
  background: rgba(47, 111, 237, 0.1);
  border-color: rgba(47, 111, 237, 0.3);
}

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #101c3d 0%, #1c3f8f 48%, #2f6fed 100%);
  overflow: hidden;
}

.login-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 28px;
  position: relative;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  transform: rotate(-18deg);
  border-radius: 28px;
  pointer-events: none;
}

.login-page::before {
  background: rgba(255, 255, 255, 0.08);
  height: 360px;
  left: -140px;
  top: -120px;
  width: 520px;
}

.login-page::after {
  background: rgba(255, 255, 255, 0.1);
  bottom: -180px;
  height: 420px;
  right: -160px;
  width: 560px;
}

.login-panel {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(4, 12, 32, 0.4);
  color: #1d2730;
  margin: 0 auto;
  max-width: 430px;
  padding: 34px 36px 30px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.login-brand {
  justify-content: center;
  margin-bottom: 20px;
}

.login-brand .brand-mark {
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.3);
}

.login-brand strong {
  color: #101828;
}

.login-brand small {
  color: #7d8aa0;
}

.login-panel h1 {
  color: #14224a;
  font-size: 22px;
  text-align: center;
}

.login-copy,
.login-footnote {
  color: #65717d;
  font-weight: 600;
  margin: 8px 0 0;
  text-align: center;
}

.login-footnote {
  margin-top: 20px;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

.login-panel label {
  color: #4f5d69;
}

.login-panel input {
  background: #f6f9ff;
  border-color: #d7e1f3;
  color: #121820;
}

.login-panel input:focus {
  border-color: #2f6fed;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
}

.login-panel .button {
  min-height: 48px;
  width: 100%;
}

.alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #b91c1c;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.login-panel .alert {
  color: #9f2e28;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.metric {
  min-height: 112px;
  overflow: hidden;
  padding: 16px 18px;
  position: relative;
}

.metric::before {
  background: linear-gradient(90deg, var(--brand), transparent);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric span,
.metric small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  color: #0b1220;
  display: block;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 8px;
}

.metric.primary::before {
  background: linear-gradient(90deg, var(--cyan), var(--brand));
}

.metric.warning::before {
  background: linear-gradient(90deg, var(--accent), var(--danger));
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  align-items: center;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 54px;
  padding: 14px 16px;
}

.panel-head.tight {
  background: transparent;
  border-bottom: 0;
  min-height: 42px;
  padding: 0 0 10px;
}

.form-grid,
.filters {
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

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

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

.filters {
  align-items: end;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

label {
  color: #364152;
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}

input,
select,
textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 39px;
  outline: none;
  padding: 8px 10px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 111, 237, 0.65);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: auto;
  width: auto;
}

.checkline {
  align-items: center;
  display: flex;
  gap: 8px;
}

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

.form-actions {
  align-self: end;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.button {
  align-items: center;
  background: linear-gradient(180deg, #3f7bf0, var(--brand-strong));
  border: 1px solid #2757c9;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.button.ghost {
  background: #eef3ff;
  border-color: #cddcf8;
  box-shadow: none;
  color: var(--brand-strong);
}

.button.danger {
  background: #fef2f2;
  border-color: #f8caca;
  box-shadow: none;
  color: #b91c1c;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

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

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

th {
  background: #f7f9fd;
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f5f8ff;
}

.empty {
  color: var(--muted);
  padding: 24px 12px;
  text-align: center;
}

.actions {
  display: flex;
  gap: 8px;
  min-width: 170px;
}

.actions form {
  margin: 0;
}

.inline-reset-form {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(240px, 1fr) auto;
  margin: 0;
  min-width: 430px;
}

.inline-reset-form input,
.inline-reset-form .button {
  margin: 0;
}

@media (max-width: 760px) {
  .inline-reset-form {
    grid-template-columns: minmax(260px, 1fr);
    min-width: 300px;
  }
}

.status {
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1;
  padding: 6px 9px;
  text-transform: capitalize;
}

.status.ativa,
.status.ativo,
.status.pago,
.status.recebido,
.status.conferido {
  background: #dcfce7;
  border-color: #bbf1cd;
  color: #15803d;
}

.status.inativa,
.status.inativo,
.status.cancelado {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.status.aberto,
.status.em_conferencia,
.status.reaberto,
.status.baixa,
.status.media,
.status.pendente,
.status.agendado,
.status.aguardando,
.status.parcial,
.status.importado {
  background: #fef3c7;
  border-color: #fce29b;
  color: #92400e;
}

.status.alta,
.status.critica,
.status.atrasado,
.status.divergente {
  background: #fee2e2;
  border-color: #fac9c9;
  color: #b91c1c;
}


.status.fechado,
.status.conciliado,
.status.agrupado {
  background: #dcfce7;
  border-color: #bbf1cd;
  color: #15803d;
}

.status.nao_identificado {
  background: #fee2e2;
  border-color: #fac9c9;
  color: #b91c1c;
}

.match-line {
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

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

.rateio-box,
.recebimentos-box {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

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

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

.segmented label {
  align-items: center;
  background: #f4f6fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  gap: 6px;
  padding: 7px 10px;
}

.computed {
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.08), rgba(47, 111, 237, 0.05));
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
}

.computed span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.computed strong {
  color: #0b1220;
  font-size: 18px;
}

.inline-confirm {
  display: grid;
  gap: 8px;
  grid-template-columns: 140px 180px 110px 130px 140px auto;
  min-width: 860px;
}

.hidden {
  display: none !important;
}



.import-layout {
  align-items: stretch;
}

.upload-zone {
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.08), rgba(13, 148, 136, 0.06));
  border: 1px dashed rgba(47, 111, 237, 0.35);
  border-radius: var(--radius);
  padding: 16px;
}

.import-help .metric-grid.compact,
.metric-grid.compact {
  grid-template-columns: 1fr;
}

.import-summary .metric strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.import-controls {
  margin-bottom: 14px;
}

.inline-input {
  min-width: 220px;
}

.inline-input.small {
  min-width: 130px;
}

.text-preview {
  background: #0f1420;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  color: #d9e5ef;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

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

.insight-list li {
  background: #fef3c7;
  border: 1px solid #fce29b;
  border-radius: var(--radius);
  color: #92400e;
  font-weight: 650;
  padding: 10px 12px;
}

.report-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.section-title h2 {
  color: var(--blue-soft);
  font-size: 18px;
  margin: 0;
}

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

.report-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  min-height: 188px;
  padding: 16px;
}

.report-card-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.report-card h3 {
  color: #101828;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  margin: 0;
}

.report-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.priority {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.priority.alta {
  background: #fee2e2;
  color: var(--danger);
}

.priority.media,
.priority.media {
  background: #fef3c7;
  color: var(--warning);
}

@media (prefers-reduced-motion: no-preference) {
  .content > *,
  .login-panel {
    animation: rise-in 520ms ease both;
  }

  .sidebar a,
  .button,
  .quick-link,
  input,
  select,
  textarea,
  .panel,
  .metric,
  tbody tr {
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, color 220ms ease, transform 220ms ease;
  }

  .button:hover,
  .quick-link:hover,
  .metric:hover,
  .panel:hover {
    transform: translateY(-1px);
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.sidebar-backdrop {
  display: none;
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .shell,
  #app-shell.sidebar-expanded {
    grid-template-columns: 1fr;
  }

  .shell:not(.sidebar-expanded) .sidebar {
    display: none;
  }

  .sidebar-backdrop {
    background: rgba(9, 14, 26, 0.55);
    border: 0;
    display: block;
    inset: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 220ms ease;
    z-index: 1590;
  }

  .shell.sidebar-expanded .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .shell.sidebar-expanded .sidebar {
    box-shadow: 24px 0 56px rgba(15, 23, 42, 0.28);
    height: 100vh;
    inset: 0 auto 0 0;
    max-width: 85vw;
    overflow-y: auto;
    padding: 18px 14px;
    position: fixed;
    width: 300px;
    z-index: 1600;
  }

  .shell.sidebar-expanded .brand {
    justify-content: flex-start;
  }

  .shell.sidebar-expanded .brand-text {
    display: block;
  }

  .shell.sidebar-expanded .nav-title {
    color: #5b6883;
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0 12px 6px;
    text-transform: uppercase;
  }

  .shell.sidebar-expanded .nav-group + .nav-group {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .shell.sidebar-expanded .sidebar a {
    gap: 10px;
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .shell.sidebar-expanded .sidebar a .nav-label {
    background: none;
    border: 0;
    box-shadow: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    left: auto;
    opacity: 1;
    padding: 0;
    pointer-events: auto;
    position: static;
    transform: none;
  }

  .nav-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .split,
  .form-grid,
  .form-grid.wide,
  .form-grid.nested,
  .filters {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .inline-confirm {
    grid-template-columns: 1fr;
    min-width: 260px;
  }
}

@media (max-width: 700px) {
  .content {
    padding: 14px;
  }

  .topbar {
    display: grid;
    position: static;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .quick-actions,
  .topbar-actions form,
  .topbar-actions select,
  .topbar-date,
  .user-chip,
  .button {
    width: 100%;
  }

  .nav-menu,
  .sidebar nav {
    grid-template-columns: 1fr;
  }

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


.report-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.report-tabs a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-height: 48px;
  padding: 10px 12px;
}

.report-tabs a:hover,
.report-tabs a.active {
  background: rgba(47, 111, 237, 0.08);
  border-color: rgba(47, 111, 237, 0.4);
  color: var(--blue-soft);
}

.report-filter-panel .panel-head > div {
  display: grid;
  gap: 4px;
}

.report-filter-panel .panel-head p {
  margin: 0;
}

.report-filters {
  grid-template-columns: repeat(4, minmax(145px, 1fr));
}

.report-filters .button {
  align-self: end;
  min-height: 42px;
}

.report-totalizers {
  margin-bottom: 16px;
}

.simple-bars {
  display: grid;
  gap: 11px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 220px) minmax(180px, 1fr) minmax(105px, auto);
  min-height: 30px;
}

.bar-label {
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  background: #eef1f7;
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 13px;
  overflow: hidden;
}

.bar-fill {
  background: linear-gradient(90deg, var(--cyan), var(--brand));
  display: block;
  height: 100%;
  min-width: 3px;
}

.bar-fill.negative {
  background: linear-gradient(90deg, #f0a34a, #dc2626);
}

.bar-row strong {
  color: #101828;
  font-size: 12px;
  text-align: right;
}

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

  .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .report-tabs,
  .report-filters {
    grid-template-columns: 1fr;
  }

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

  .bar-row strong {
    text-align: left;
  }
}

.status.disponivel,
.status.compensado {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf1cd;
}


.muted { color: var(--muted); margin: 4px 0 0; }
.activity-timeline { display: grid; padding: 8px 16px 16px; }
.activity-item { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 14px; grid-template-columns: 140px minmax(0, 1fr) auto; padding: 12px 0; }
.activity-item.sensitive { border-left: 3px solid var(--warning); padding-left: 12px; }
.activity-item time, .activity-item small { color: var(--muted); font-size: 12px; }
.activity-item strong, .activity-item small { display: block; }
.activity-timeline.compact .activity-item { grid-template-columns: 125px minmax(0, 1fr); }
.audit-filters { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.audit-table { min-width: 1700px; }
.audit-value { font-family: Consolas, monospace; font-size: 12px; max-width: 260px; overflow-wrap: anywhere; }
.table-subtext { color: var(--muted); display: block; font-size: 11px; margin-top: 3px; }
.backup-actions { display: flex; gap: 12px; padding: 16px; }
.notice { background: rgba(13, 148, 136, 0.07); border-left: 3px solid var(--cyan); color: #0f4b45; margin: 0 16px 16px; padding: 14px; }
.path-value { font-family: Consolas, monospace; font-size: 14px !important; overflow-wrap: anywhere; }
.audit-alerts { display: grid; padding: 6px 16px 16px; }
.audit-alerts > div { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px 0; }
.audit-alerts .warning-row strong { color: var(--warning); }
@media (max-width: 1180px) { .audit-filters { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .activity-item, .activity-timeline.compact .activity-item { grid-template-columns: 1fr; } .backup-actions { display: grid; } }

.account-units { display: grid; gap: 8px; }
.field-title { color: var(--muted); font-size: 12px; font-weight: 800; }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media(max-width:700px){.check-grid{grid-template-columns:1fr;}}

.shared-account-grid{display:grid;gap:12px;grid-template-columns:repeat(3,minmax(0,1fr));padding:16px}.shared-account{background:var(--panel-soft);border:1px solid var(--line);border-radius:var(--radius);display:grid;gap:10px;padding:14px}.shared-account strong,.shared-account small{display:block}.shared-account small,.shared-account li{color:var(--muted);font-size:12px}.shared-account>span{color:var(--brand-strong);font-size:20px;font-weight:800}.shared-account ul{list-style:none;margin:0;padding:0}.shared-account li{border-top:1px solid var(--line);padding:6px 0}@media(max-width:1180px){.shared-account-grid{grid-template-columns:1fr}}

.exceptional-account{background:#fffbeb;border:1px solid #fce29b;border-radius:var(--radius);display:grid;gap:10px;padding:12px}.exceptional-account:has(input:not(:checked)) label:last-child{display:none}

.alert.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #15803d;
}

.choice-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 10px;
}

.choice-group legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

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

@media (max-width: 760px) {
  .anticipation-metrics {
    grid-template-columns: 1fr;
  }
}
.metric.danger{border-color:#f8caca;box-shadow:inset 0 0 0 1px rgba(220,38,38,.14)}.metric.danger strong{color:var(--danger)}



.sidebar-toggle {
  align-items: center;
  background: #eef3ff;
  border: 1px solid #cddcf8;
  border-radius: 8px;
  color: var(--brand-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  min-width: 38px;
}

.shell.sidebar-expanded {
  grid-template-columns: 272px minmax(0, 1fr);
}

.shell.sidebar-expanded .sidebar {
  padding: 18px 14px;
}

.shell.sidebar-expanded .brand {
  justify-content: flex-start;
}

.shell.sidebar-expanded .brand-text {
  display: block;
}

.shell.sidebar-expanded .nav-title {
  color: #5b6883;
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0 12px 6px;
  text-transform: uppercase;
}

.shell.sidebar-expanded .nav-group + .nav-group {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.shell.sidebar-expanded .sidebar a {
  gap: 10px;
  justify-content: flex-start;
  padding: 9px 12px;
}

.shell.sidebar-expanded .sidebar a .nav-label {
  background: none;
  border: 0;
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  left: auto;
  opacity: 1;
  padding: 0;
  pointer-events: auto;
  position: static;
  transform: none;
}

.page-help {
  background: rgba(13, 148, 136, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  color: #0f4b45;
  font-weight: 650;
  margin-bottom: 16px;
  padding: 12px 14px;
}


.combo-select {
  position: relative;
  width: 100%;
}

.combo-native {
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

.combo-trigger {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 11px;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  width: 100%;
}

.combo-trigger:hover,
.combo-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
}

.combo-trigger.is-empty .combo-trigger-text {
  color: var(--muted);
}

.combo-caret {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.combo-panel {
  background: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  left: 0;
  margin-top: 4px;
  max-height: 300px;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 80;
}

.combo-searchbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 34px 34px;
  padding: 8px;
}

.combo-search-input {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 34px;
  padding: 7px 9px;
  width: 100%;
}

.combo-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.18);
  outline: none;
}

.combo-icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--brand-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 21px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
  width: 34px;
}

.combo-icon-button:hover {
  background: rgba(47, 111, 237, 0.1);
  color: var(--brand-strong);
}

.combo-results {
  max-height: 230px;
  overflow-y: auto;
}

.combo-option {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 10px;
  text-align: left;
  transition: background 140ms ease;
  width: 100%;
}

.combo-option:hover,
.combo-option:focus,
.combo-option.is-active {
  background: rgba(47, 111, 237, 0.08);
  outline: none;
}

.combo-option-name {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.combo-option-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.combo-empty {
  color: var(--muted);
  font-weight: 650;
  padding: 14px 10px;
}

.combo-empty.is-error {
  color: #b91c1c;
}

.fechamento-help {
  align-self: start;
  background: rgba(13, 148, 136, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  color: #0f4b45;
  display: grid;
  gap: 8px;
  padding: 13px 14px;
}

.fechamento-help strong {
  color: #0b1220;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fechamento-help p {
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-row .inline-form { margin: 0; }

.import-classification-table table {
  min-width: 1800px;
}

.import-classification-table select {
  min-width: 180px;
}

.import-classification-table .inline-select.compact {
  min-width: 135px;
}

.import-classification-table .suggestion-note {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  line-height: 1.3;
  margin-top: 6px;
  max-width: 210px;
}

.import-classification-table .inline-input {
  min-width: 260px;
}

.import-classification-table .inline-input.small {
  min-width: 150px;
}

.section-note {
  margin: -4px 0 14px;
}
.combo-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-resource-contas .combo-panel {
  max-width: min(520px, calc(100vw - 24px));
  min-width: min(380px, calc(100vw - 24px));
  right: auto;
  width: max(100%, 380px);
}

.combo-resource-contas .combo-option {
  grid-template-columns: minmax(0, 1fr);
}

.combo-resource-contas .combo-option-name {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.combo-resource-contas .combo-option-meta {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel:has(.combo-panel:not([hidden])),
.table-wrap:has(.combo-panel:not([hidden])) {
  overflow: visible;
}

.combo-panel.align-right {
  left: auto;
  right: 0;
}

.combo-resource-contas .combo-panel {
  max-width: min(640px, calc(100vw - 24px));
  min-width: min(460px, calc(100vw - 24px));
  width: max(100%, 460px);
}

.combo-resource-contas .combo-searchbar {
  grid-template-columns: minmax(220px, 1fr) 34px 34px;
}

@media (max-width: 1180px) {
  .combo-resource-contas .combo-panel {
    min-width: min(420px, calc(100vw - 24px));
    width: min(520px, calc(100vw - 24px));
  }

  .import-classification-table table {
    min-width: 1550px;
  }
}

@media (max-width: 700px) {
  .combo-panel,
  .combo-resource-contas .combo-panel {
    max-height: min(70vh, 420px);
    max-width: calc(100vw - 24px);
    min-width: calc(100vw - 28px);
    width: calc(100vw - 28px);
  }

  .combo-searchbar,
  .combo-resource-contas .combo-searchbar {
    grid-template-columns: minmax(0, 1fr) 34px 34px;
  }

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

  .combo-option-meta {
    margin-top: 2px;
    text-align: left;
    white-space: normal;
  }

  .import-classification-table table {
    min-width: 1280px;
  }
}
/* Ajustes responsivos para importacoes e selecoes amplas */
.import-classification-table {
  max-height: min(70vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.import-classification-table:has(.combo-panel:not([hidden])) {
  overflow: auto;
}

.import-classification-table table {
  min-width: 2040px;
}

.import-classification-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.import-classification-table .inline-input {
  min-width: 280px;
}

.import-classification-table .inline-input.small {
  min-width: 160px;
}

.import-classification-table .combo-select {
  min-width: 190px;
}

@media (max-width: 1320px) {
  .import-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-help,
  .page-help {
    display: none;
  }

  .topbar {
    align-items: stretch;
  }

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

  .quick-actions {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quick-link {
    white-space: nowrap;
  }

  .import-classification-table {
    max-height: calc(100vh - 220px);
  }

  .import-classification-table table {
    min-width: 1900px;
  }
}

@media (max-width: 700px) {
  .import-classification-table {
    max-height: calc(100vh - 180px);
  }

  .import-classification-table table {
    min-width: 1500px;
  }
}
/* UX refresh - operational density, resilient controls and print-friendly reports */
:root {
  --surface: #ffffff;
  --border: var(--line);
  --primary: var(--brand);
  --blue-soft: var(--brand-strong);
  --focus-ring: 0 0 0 3px rgba(47, 111, 237, 0.18);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.combo-trigger:focus-visible,
.combo-option:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.page-help {
  margin-bottom: 16px;
  padding: 0;
}

.page-help summary {
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  padding: 12px 14px;
}

.page-help summary::-webkit-details-marker {
  display: none;
}

.page-help summary::after {
  content: "Recolher";
  color: var(--muted);
  float: right;
  font-size: 12px;
}

.page-help:not([open]) summary::after {
  content: "Abrir";
}

.page-help p {
  border-top: 1px solid rgba(13, 148, 136, 0.16);
  margin: 0;
  padding: 0 14px 13px;
}

.combo-panel.combo-floating {
  margin-top: 0;
  position: fixed;
  right: auto;
  top: auto;
  z-index: 2000;
}

.combo-panel.combo-floating .combo-results {
  max-height: calc(var(--combo-max-height, 360px) - 64px);
}

.combo-searchbar {
  position: sticky;
  top: 0;
  z-index: 2;
}

.combo-option-name,
.combo-trigger-text {
  word-break: normal;
}

.table-wrap {
  border-top: 1px solid var(--line);
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  touch-action: pan-x pan-y;
}

.data-table th,
.data-table td,
.import-classification-table th,
.import-classification-table td {
  white-space: nowrap;
}

.data-table td,
.import-classification-table td {
  background: #ffffff;
}

.data-table thead th,
.import-classification-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.report-tabs-wrap {
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.report-tabs-wrap .report-tabs {
  margin-bottom: 0;
  min-width: 980px;
}

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

.filter-disclosure {
  border-top: 1px solid var(--line);
}

.filter-disclosure summary {
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 12px 16px 0;
  text-transform: uppercase;
}

.filter-disclosure .report-filters {
  padding-top: 12px;
}

.report-table-wrap {
  max-height: min(68vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
}

.report-table-wrap .data-table {
  min-width: 980px;
}

.import-classification-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.import-classification-table th:first-child,
.import-classification-table td:first-child {
  left: 0;
  min-width: 54px;
  position: sticky;
  z-index: 8;
}

.import-classification-table th:nth-child(2),
.import-classification-table td:nth-child(2) {
  left: 54px;
  min-width: 300px;
  position: sticky;
  z-index: 7;
}

.import-classification-table th:first-child,
.import-classification-table th:nth-child(2) {
  z-index: 11;
}

.import-classification-table th:last-child,
.import-classification-table td:last-child {
  box-shadow: -12px 0 18px rgba(15, 23, 42, 0.08);
  min-width: 118px;
  position: sticky;
  right: 0;
  text-align: right;
  z-index: 8;
}

.import-classification-table th:last-child {
  z-index: 11;
}

.statement-classification-row.is-transfer td {
  background: #f0fdfa;
}

@media (max-width: 1320px) {
  .page-help:not([open]) {
    display: block;
  }

  .page-help[open] {
    display: block;
  }

  .report-tabs-wrap .report-tabs {
    min-width: 760px;
  }
}

@media (max-width: 700px) {
  .report-actions,
  .report-actions .button {
    width: 100%;
  }

  .report-tabs-wrap .report-tabs {
    min-width: 640px;
  }
}

@media print {
  body {
    color: #111827 !important;
  }

  .sidebar,
  .topbar,
  .report-tabs-wrap,
  .filter-disclosure,
  .quick-actions,
  .button,
  .page-help {
    display: none !important;
  }

  .shell {
    display: block !important;
  }

  .content {
    padding: 0 !important;
  }

  .panel,
  .metric {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    color: #111827 !important;
  }

  .report-table-wrap,
  .table-wrap {
    max-height: none !important;
    overflow: visible !important;
  }

  th,
  td {
    color: #111827 !important;
  }
}

/* Layered UX refresh - progressive disclosure for operational screens */
.focus-panel {
  border-color: rgba(47, 111, 237, 0.22);
  box-shadow: var(--shadow);
}

.layer-panel,
.progressive-disclosure {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.layer-panel > summary,
.progressive-disclosure > summary {
  align-items: center;
  color: #16202f;
  cursor: pointer;
  display: flex;
  font-size: 13.5px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  min-height: 48px;
  padding: 14px 16px;
}

.layer-panel > summary::-webkit-details-marker,
.progressive-disclosure > summary::-webkit-details-marker {
  display: none;
}

.layer-panel > summary::after,
.progressive-disclosure > summary::after {
  color: var(--muted);
  content: "Abrir";
  font-size: 12px;
  font-weight: 800;
}

.layer-panel[open] > summary::after,
.progressive-disclosure[open] > summary::after {
  content: "Recolher";
}

.layer-panel > :not(summary),
.progressive-disclosure > :not(summary) {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.layer-grid {
  display: grid;
  gap: 14px;
}

.workflow-strip,
.table-toolbar {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.workflow-strip span,
.table-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-strip strong,
.table-toolbar strong {
  color: #101828;
}

.form-section-title {
  align-items: center;
  background: rgba(47, 111, 237, 0.06);
  border: 1px solid rgba(47, 111, 237, 0.16);
  border-radius: var(--radius);
  color: var(--brand-strong);
  display: flex;
  font-size: 11.5px;
  font-weight: 800;
  min-height: 38px;
  padding: 9px 11px;
  text-transform: uppercase;
}

.sticky-action-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.98));
  border-top: 1px solid var(--line);
  bottom: 0;
  justify-content: flex-end;
  margin: 0 -16px -16px;
  padding: 12px 16px;
  position: sticky;
  z-index: 12;
}

.form-grid .span-4,
.filters .span-4 {
  grid-column: 1 / -1;
}

.progressive-disclosure .form-grid,
.layer-panel .form-grid,
.layer-panel .filters {
  margin: 0;
}

.fechamento-help.progressive-disclosure {
  display: block;
  padding: 0;
}

.fechamento-help.progressive-disclosure > summary {
  border-left: 3px solid var(--cyan);
}

.fechamento-help.progressive-disclosure p {
  font-size: 13px;
  max-width: 1100px;
}

.layer-panel .text-preview,
.technical-layer .text-preview {
  margin: 0;
  max-height: 42vh;
}

.import-classification-table {
  background: #ffffff;
}

.import-classification-table tbody tr:hover td,
.card-purchases-table tbody tr:hover td {
  background: #f5f8ff;
}

@media (max-width: 1320px) {
  .workflow-strip,
  .table-toolbar {
    align-items: stretch;
  }

  .sticky-action-bar {
    position: sticky;
  }
}
/* Layered module navigation, drawers and multistep forms */
.module-commandbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.module-commandbar > div {
  min-width: 0;
}

.module-commandbar h2,
.module-commandbar p {
  margin: 0;
}

.module-commandbar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-tabs {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.module-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
}

.module-tab:hover,
.module-tab:focus-visible {
  color: var(--brand-strong);
  outline: none;
}

.module-tab.is-active,
.module-tab[aria-selected="true"] {
  border-bottom-color: var(--brand);
  color: var(--brand-strong);
}

.module-view[hidden],
.app-drawer[hidden],
.wizard-step[hidden] {
  display: none !important;
}

.list-toolbar {
  align-items: end;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
  padding: 14px 16px;
}

.list-toolbar .form-actions {
  align-self: end;
}

.pagination-bar {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
}

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

.pagination-actions .button {
  min-width: 92px;
}

.row-primary {
  color: #101828;
  display: block;
  font-weight: 750;
}

.row-secondary {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.action-menu {
  position: relative;
}

.action-menu > summary {
  align-items: center;
  background: #eef3ff;
  border: 1px solid #cddcf8;
  border-radius: 7px;
  color: var(--brand-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  justify-content: center;
  list-style: none;
  min-height: 34px;
  min-width: 38px;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu-popover {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 30;
}

.action-menu-popover .button,
.action-menu-popover form,
.action-menu-popover form .button {
  justify-content: flex-start;
  margin: 0;
  width: 100%;
}

body.drawer-open {
  overflow: hidden;
}

.app-drawer {
  inset: 0;
  position: fixed;
  z-index: 1600;
}

.drawer-backdrop {
  background: rgba(9, 14, 26, 0.55);
  border: 0;
  inset: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  transition: opacity 260ms ease;
  width: 100%;
}

.drawer-sheet {
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 56px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-width: min(920px, calc(100vw - 72px));
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(102%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 78vw;
}

.app-drawer.is-open .drawer-backdrop {
  opacity: 1;
}

.app-drawer.is-open .drawer-sheet {
  transform: translateX(0);
}

.drawer-header {
  align-items: center;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px 20px;
}

.drawer-header h2,
.drawer-header p {
  margin: 0;
}

.drawer-header p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.icon-close {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.drawer-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.drawer-body .form-grid {
  padding: 0;
}

.drawer-footer {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px 20px;
}

.drawer-footer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.wizard-progress {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-auto-columns: minmax(120px, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 0 20px;
}

.wizard-progress-step {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 58px;
  padding: 10px 8px;
  text-align: left;
}

.wizard-progress-step span {
  align-items: center;
  background: #eef1f7;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #475569;
  display: inline-flex;
  flex: 0 0 26px;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
}

.wizard-progress-step strong {
  font-size: 12px;
  line-height: 1.25;
}

.wizard-progress-step.is-current {
  border-bottom-color: var(--brand);
  color: #101828;
}

.wizard-progress-step.is-current span {
  background: var(--brand);
  border-color: var(--brand-strong);
  color: #ffffff;
}

.wizard-progress-step.is-complete span {
  background: #dcfce7;
  border-color: #bbf1cd;
  color: #15803d;
}

.wizard-progress-step:disabled {
  cursor: default;
  opacity: 0.55;
}

.wizard-step {
  border: 0;
  margin: 0;
  min-inline-size: 0;
  padding: 0;
}

.wizard-step > legend {
  color: #0b1220;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  padding: 0;
}

.step-intro {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.wizard-counter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.wizard-review {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.wizard-review-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  padding: 11px 13px;
}

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

.wizard-review-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wizard-review-row strong {
  color: #101828;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.conditional-group {
  border: 1px solid rgba(47, 111, 237, 0.18);
  border-radius: 8px;
  grid-column: 1 / -1;
  padding: 14px;
}

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

.list-empty-state {
  color: var(--muted);
  padding: 36px 20px;
  text-align: center;
}

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

  .list-toolbar .search-wide {
    grid-column: 1 / -1;
  }

  .drawer-sheet {
    max-width: calc(100vw - 34px);
    width: 88vw;
  }
}

@media (max-width: 700px) {
  .module-commandbar,
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .module-actions,
  .module-actions .button,
  .pagination-actions,
  .pagination-actions .button {
    width: 100%;
  }

  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .list-toolbar .search-wide {
    grid-column: auto;
  }

  .drawer-sheet {
    border-left: 0;
    max-width: none;
    width: 100vw;
  }

  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wizard-progress {
    display: flex;
    padding: 0 12px;
  }

  .wizard-progress-step {
    flex: 0 0 auto;
    min-width: 48px;
  }

  .wizard-progress-step strong {
    display: none;
  }

  .wizard-review-row,
  .compact-info-grid {
    grid-template-columns: 1fr;
  }

  .drawer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .drawer-footer-actions,
  .drawer-footer-actions .button {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer-backdrop,
  .drawer-sheet {
    transition: none;
  }
}

.table-wrap:has(.action-menu[open]) { overflow: visible; }

.notice.warning {
  background: #fffbeb;
  border-left-color: #d97706;
  color: #92400e;
}

.notice.danger {
  background: #fef2f2;
  border-left-color: #dc2626;
  color: #b91c1c;
}

.notice.success {
  background: #ecfdf5;
  border-left-color: #16a34a;
  color: #15803d;
}

.inline-details {
  min-width: 110px;
}

.inline-details > summary {
  color: var(--cyan);
  cursor: pointer;
  font-weight: 700;
}

.inline-details > p,
.inline-details > form {
  margin: 8px 0 0;
  max-width: 420px;
  white-space: normal;
}

.stacked-form {
  display: grid;
  gap: 8px;
  min-width: min(360px, 76vw);
}

.stacked-form label {
  display: grid;
  gap: 4px;
}

#aviso-pendencias-fornecedor {
  margin: 0;
}

#aviso-pendencias-fornecedor p {
  margin: 8px 0;
}

.import-upload-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
  .import-upload-form {
    grid-template-columns: 1fr;
  }

  .import-upload-form .span-2 {
    grid-column: auto;
  }
}

/* Dashboard KPI hero and inline chart bars */
.kpi-hero {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 18px;
  padding: 20px 22px;
}

.kpi-ring {
  --ring-value: 0;
  aspect-ratio: 1;
  background: conic-gradient(var(--brand) calc(var(--ring-value) * 1%), #e7ecf7 0);
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 108px;
}

.kpi-ring::before {
  background: #ffffff;
  border-radius: 50%;
  content: "";
  inset: 10px;
  position: absolute;
}

.kpi-ring {
  position: relative;
}

.kpi-ring span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  z-index: 1;
}

.kpi-hero-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.kpi-hero-figures div {
  display: grid;
  gap: 4px;
}

.kpi-hero-figures span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-hero-figures strong {
  color: #0b1220;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.metric-icon {
  align-items: center;
  background: rgba(47, 111, 237, 0.1);
  border-radius: 8px;
  color: var(--brand-strong);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  margin-bottom: 8px;
  width: 30px;
}

.metric-icon svg {
  height: 16px;
  width: 16px;
}

svg:has(> use[href^="#icon-"]) {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.metric.primary .metric-icon {
  background: rgba(13, 148, 136, 0.12);
  color: var(--cyan);
}

.metric.warning .metric-icon,
.metric.danger .metric-icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

@media (max-width: 700px) {
  .kpi-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* Birthday reminders: dashboard panel + imminent popup */
.birthday-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 8px;
}

.birthday-item {
  align-items: center;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 10px 8px;
}

.birthday-item:hover {
  background: var(--panel-soft);
}

.birthday-icon {
  align-items: center;
  background: rgba(217, 119, 6, 0.12);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.birthday-icon svg {
  height: 16px;
  width: 16px;
}

.birthday-info {
  min-width: 0;
}

.birthday-info strong {
  color: #101828;
  display: block;
  font-size: 13px;
}

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

.birthday-days {
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  font-size: 11.5px;
  font-weight: 750;
  padding: 5px 10px;
  white-space: nowrap;
}

.birthday-item.is-imminent .birthday-icon {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.birthday-item.is-imminent .birthday-days {
  background: #fee2e2;
  color: #b91c1c;
}

.birthday-modal-overlay {
  align-items: center;
  background: rgba(9, 14, 26, 0.6);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 2000;
}

.birthday-modal-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(4, 12, 32, 0.4);
  max-width: 420px;
  padding: 28px 26px 24px;
  position: relative;
  text-align: center;
  width: 100%;
}

.birthday-modal-close {
  background: #f1f5f9;
  border: 0;
  border-radius: 50%;
  color: #475569;
  cursor: pointer;
  font-size: 18px;
  height: 32px;
  line-height: 1;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
}

.birthday-modal-icon {
  align-items: center;
  background: rgba(217, 119, 6, 0.12);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 56px;
  justify-content: center;
  margin: 0 auto 14px;
  width: 56px;
}

.birthday-modal-icon svg {
  height: 26px;
  width: 26px;
}

.birthday-modal-card h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.birthday-modal-intro {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

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

.birthday-modal-list li {
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.birthday-modal-list strong {
  color: #101828;
  display: block;
  font-size: 13px;
}

.birthday-modal-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.birthday-modal-card .button {
  width: 100%;
}
