:root {
  color-scheme: light;
  --ink: #1f2e37;
  --ink-soft: #40535d;
  --muted: #5c727b;
  --soft: #82939a;
  --canvas: #e8edef;
  --canvas-warm: #f8f5ef;
  --surface: #fffdfa;
  --surface-soft: #f3f5f4;
  --line: #d3dcde;
  --line-strong: #aab8bd;
  --forest: #1f2e37;
  --forest-soft: #30444e;
  --lime: #f2b968;
  --lime-strong: #d69a45;
  --blue: #dce3e5;
  --blue-strong: #5c727b;
  --peach: #f7d9ad;
  --danger: #a84538;
  --success: #4f6f67;
  --warning: #8a5b18;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 8px 22px rgba(31, 46, 55, 0.08);
  --shadow-lg: 0 24px 68px rgba(31, 46, 55, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 7%, rgba(45, 140, 255, 0.14), transparent 26rem),
    linear-gradient(135deg, var(--canvas-warm), var(--canvas));
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(45, 140, 255, 0.42);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: #0b5fcc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Sidebar */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  color: #f4f8f2;
  background:
    radial-gradient(circle at 24% 8%, rgba(45, 140, 255, 0.09), transparent 17rem),
    var(--forest);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 2px 4px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  overflow: hidden;
  color: var(--forest);
  background: var(--lime);
  border-radius: 15px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.brand-stripes {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 18px;
  background: repeating-linear-gradient(90deg, var(--forest) 0 2px, transparent 2px 5px);
  opacity: 0.74;
  transform: skewX(-14deg);
}

.brand-letter {
  position: relative;
  z-index: 1;
  margin-left: 17px;
  font-family: "Manrope", sans-serif;
  font-size: 21px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  margin: 0 0 3px;
  color: var(--lime);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.brand-block h1,
.topbar h2,
.panel h3,
.detail-dialog h3 {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.04em;
}

.brand-block h1 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 24px;
}

.nav-caption {
  margin: 0 0 6px;
  padding: 0 12px;
  color: #819087;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item,
.icon-button,
.icon-only,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  text-decoration: none;
  transition: border-color 170ms ease, background 170ms ease, color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.nav-item {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  padding: 11px 12px;
  color: #98a39b;
  font-size: 0.9rem;
  font-weight: 650;
}

.nav-item svg,
.icon-button svg,
.icon-only svg,
.search-field svg,
.upload-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.nav-item:hover {
  color: #f4f8f2;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.active {
  color: var(--forest);
  background: var(--lime);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.nav-item.active svg {
  stroke-width: 2.2;
}

.sidebar-footer {
  margin-top: auto;
  padding: 15px;
  color: #b7c0b9;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

.sidebar-footer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(45, 140, 255, 0.11);
}

.sidebar-footer .label {
  color: #f1f5ef;
}

.sidebar-footer p:last-of-type {
  margin: 13px 0 4px;
  color: #f5f7f4;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sidebar-footer small {
  color: #7d8a81;
  font-size: 0.7rem;
  line-height: 1.45;
}

/* Main header */

.main-content {
  min-width: 0;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 28px 56px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 206px;
  overflow: hidden;
  gap: 28px;
  margin-bottom: 18px;
  padding: 31px 30px 28px;
  color: #fff;
  background:
    linear-gradient(112deg, rgba(16, 29, 22, 0.99), rgba(24, 45, 31, 0.97)),
    var(--forest);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.topbar::before {
  content: "";
  position: absolute;
  top: -135px;
  right: 5%;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(45, 140, 255, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(45, 140, 255, 0.035),
    0 0 0 86px rgba(45, 140, 255, 0.025),
    inset 0 0 0 64px rgba(45, 140, 255, 0.018);
}

.topbar::after {
  content: "FATURAMENTO";
  position: absolute;
  right: 22px;
  bottom: -20px;
  color: rgba(255, 255, 255, 0.026);
  font-family: "Manrope", sans-serif;
  font-size: clamp(4rem, 8vw, 8.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.075em;
  white-space: nowrap;
  pointer-events: none;
}

.topbar-copy,
.topbar-actions {
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-width: 0;
}

.topbar-copy {
  max-width: 760px;
}

.eyebrow,
.label {
  margin: 0;
  color: #5f6b61;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  color: #c7d1ca;
}

.topbar h2 {
  max-width: 820px;
  color: #fff;
  font-size: clamp(2.65rem, 4.7vw, 5.1rem);
  font-weight: 550;
  line-height: 0.95;
}

.topbar-summary {
  max-width: 620px;
  margin: 14px 0 0;
  color: #b8c3ba;
  font-size: 0.93rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 330px;
}

/* Actions */

.icon-button {
  min-width: 44px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.icon-button.primary {
  color: var(--forest);
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.icon-button.primary:hover {
  background: var(--lime-strong);
  border-color: var(--lime-strong);
  transform: translateY(-2px);
}

.icon-button.subtle {
  background: var(--surface);
  border-color: var(--line);
}

.topbar .icon-button.subtle {
  color: #eef2ee;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
}

.topbar .icon-button.subtle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-button.subtle:hover,
.icon-only.ghost:hover,
.text-button:hover {
  background: #edf3f6;
  border-color: var(--line-strong);
}

.import-dropzone.is-dragging {
  color: var(--forest) !important;
  background: var(--lime) !important;
  border-color: var(--lime) !important;
  transform: translateY(-2px);
}

.icon-button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.icon-only {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
}

.icon-only.ghost {
  color: var(--muted);
  border-color: var(--line);
}

.text-button {
  min-height: 38px;
  padding: 8px 12px;
  color: #0b5fcc;
  font-size: 0.8rem;
  font-weight: 750;
}

/* Views and cards */

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 260ms ease both;
}

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

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

.metric-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 172px;
  overflow: hidden;
  padding: 20px;
  background: var(--surface);
  border: 1px solid rgba(17, 29, 22, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -55px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(17, 29, 22, 0.08);
  border-radius: 50%;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(17, 29, 22, 0.1);
}

.metric-card .metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-card .label {
  padding-top: 5px;
  color: #546056;
}

.metric-card .metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(17, 29, 22, 0.1);
  border-radius: 12px;
}

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

.metric-value {
  position: relative;
  z-index: 1;
  margin: auto 0 3px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.72rem, 2.35vw, 2.65rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
}

.metric-note {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: #69736b;
  font-size: 0.74rem;
  line-height: 1.42;
}

.metric-card:nth-child(1) {
  background: var(--lime);
  border-color: var(--lime-strong);
}

.metric-card:nth-child(2) {
  background: var(--blue);
  border-color: #c8dfe5;
}

.metric-card:nth-child(3) {
  background: var(--surface);
}

.metric-card:nth-child(4) {
  background: var(--peach);
  border-color: #ead0c1;
}

.workspace-grid,
.report-grid,
.message-grid {
  display: grid;
  gap: 18px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
}

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

.panel {
  min-width: 0;
  background: rgba(255, 254, 250, 0.93);
  border: 1px solid rgba(17, 29, 22, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-heading,
.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 22px;
}

.panel .label,
.report-heading .label {
  margin-bottom: 7px;
  color: #0b5fcc;
}

.panel h3 {
  font-size: clamp(1.15rem, 1.75vw, 1.55rem);
  font-weight: 650;
  line-height: 1.05;
}

.form-panel,
.table-panel {
  overflow: hidden;
}

.form-panel > .panel-heading,
.table-panel > .panel-heading {
  border-bottom: 1px solid var(--line);
}

/* Forms */

.billing-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

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

.field,
.compact-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.compact-field > span {
  color: #667067;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

input,
select,
textarea,
.select-trigger {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: #f8f9f6;
  border: 1px solid #d9dfd5;
  border-radius: 13px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #a0a7a0;
}

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

input:hover,
textarea:hover,
.select-trigger:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
.select-control.open .select-trigger,
.date-control.open input {
  background: #fff;
  border-color: #93ad69;
  box-shadow: 0 0 0 4px rgba(45, 140, 255, 0.12);
}

.date-control,
.select-control {
  position: relative;
  min-width: 0;
}

.date-control input {
  padding-right: 42px;
  cursor: pointer;
}

.date-control > svg,
.date-control > i {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 17px;
  height: 17px;
  color: #667167;
  pointer-events: none;
  transform: translateY(-50%);
}

.native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.select-trigger {
  position: relative;
  display: block;
  padding-right: 40px;
  text-align: left;
  cursor: pointer;
}

.select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #657066;
  border-bottom: 1.5px solid #657066;
  transform: translateY(-66%) rotate(45deg);
  transition: transform 160ms ease;
}

.select-control.open .select-trigger::after {
  transform: translateY(-25%) rotate(225deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 80;
  display: grid;
  width: 100%;
  max-height: 248px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
}

.select-option {
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px 8px 29px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
}

.select-option:hover,
.select-option.active {
  color: var(--forest);
  background: #e7f2ff;
}

.select-option.active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 11px;
  width: 7px;
  height: 7px;
  background: #6b8f2c;
  border-radius: 50%;
  transform: translateY(-50%);
}

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

.upload-box {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 106px;
  overflow: hidden;
  padding: 15px;
  color: #566057;
  background: #f2f6fa;
  border: 1px dashed #c9d1c5;
  border-radius: 17px;
  cursor: pointer;
  text-align: center;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.upload-box:hover,
.upload-box.has-file,
.upload-box.is-dragging {
  color: var(--forest);
  background: rgba(45, 140, 255, 0.12);
  border-color: #2d8cff;
  transform: translateY(-2px);
}

.upload-box svg {
  margin-bottom: 8px;
}

.upload-box span {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-box small {
  margin-top: 3px;
  color: #899189;
  font-size: 0.68rem;
}

.upload-box input {
  display: none;
}

.attachment-controls,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-actions {
  padding-top: 3px;
}

.form-actions .primary {
  min-width: 184px;
}

/* Charts */

.trend-panel {
  min-height: 480px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 11%, rgba(45, 140, 255, 0.14), transparent 13rem),
    var(--forest);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}

.trend-panel .panel-heading {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trend-panel .label {
  color: var(--lime);
}

.trend-panel h3,
.trend-panel .bar-value {
  color: #fff;
}

.trend-panel .bar-row,
.trend-panel .empty-state {
  color: #aeb9b1;
}

.trend-panel .empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 300px;
}

.trend-panel .empty-state::before {
  content: "";
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  background:
    linear-gradient(145deg, transparent 45%, var(--lime) 46% 51%, transparent 52%),
    rgba(45, 140, 255, 0.06);
  border: 1px solid rgba(45, 140, 255, 0.24);
  border-radius: 18px;
}

.trend-panel .bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.trend-panel .bar-fill {
  background: linear-gradient(90deg, var(--lime), #d7dee5);
}

.bar-chart {
  display: grid;
  gap: 17px;
  padding: 26px 22px 28px;
}

.bar-chart.compact {
  max-height: 470px;
  overflow-y: auto;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px minmax(90px, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.bar-fill {
  width: var(--bar-value);
  height: 100%;
  background: linear-gradient(90deg, #0759ba, #3a9cff);
  border-radius: inherit;
  transform-origin: left;
  animation: bar-grow 500ms ease both;
}

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.bar-value {
  color: var(--ink);
  font-size: 0.75rem;
  text-align: right;
}

/* Tables */

.table-panel {
  margin-top: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid #e7ebe5;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #788078;
  background: #f7f8f4;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

td {
  color: #5f685f;
  font-size: 0.78rem;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #fafbf8;
}

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

.cell-strong {
  color: var(--ink);
  font-weight: 650;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 5px 10px;
  color: #1259a6;
  background: #eff5df;
  border: 1px solid #c2d9ef;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
}

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

.status-pill.recebida {
  color: var(--success);
  background: #e3f1ff;
  border-color: #bbd9f7;
}

.status-pill.pendente {
  color: var(--warning);
  background: #f8f0d9;
  border-color: #ead8a5;
}

.status-pill.cancelada {
  color: var(--danger);
  background: #f7e8e4;
  border-color: #e9c9c1;
}

.attachment-buttons,
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.row-billing-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 11px;
  color: var(--ink);
  white-space: nowrap;
  background: var(--lime);
  border: 1px solid var(--lime-strong);
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.row-billing-action:hover {
  background: #f7c984;
  border-color: #f8cf94;
  box-shadow: 0 5px 12px rgba(138, 91, 24, 0.16);
  transform: translateY(-1px);
}

.row-billing-action svg {
  width: 14px;
  height: 14px;
}

.mini-action {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: #657066;
  background: #f7f8f5;
  border: 1px solid #dce1d9;
  border-radius: 9px;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.mini-action:hover {
  color: var(--forest);
  background: var(--lime);
  border-color: var(--lime-strong);
  transform: translateY(-1px);
}

.mini-action svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  padding: 42px 20px;
  color: #8a938b;
  text-align: center;
}

/* Library / reports */

.filter-panel {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) repeat(2, minmax(145px, 0.7fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 17px;
}

.search-field {
  position: relative;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: #798279;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 42px;
}

.report-heading {
  margin-bottom: 18px;
}

.report-heading .compact-field {
  width: min(240px, 100%);
}

.summary-list {
  display: grid;
  gap: 0;
  padding: 0 22px 18px;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid #e6ebe3;
}

.summary-item:last-child {
  border-bottom: 0;
}

.summary-name {
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 700;
}

.summary-note {
  margin: 0;
  color: #858d85;
  font-size: 0.72rem;
}

.summary-value {
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Boleto message */

.message-workspace,
.message-output {
  padding: 0 22px 22px;
}

.message-upload-box {
  min-height: 154px;
  margin-bottom: 18px;
}

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

.message-fields .field:last-child {
  grid-column: span 2;
}

.message-output {
  display: grid;
  gap: 10px;
}

.message-output textarea {
  min-height: 326px;
  padding: 17px;
  line-height: 1.62;
}

.message-status {
  margin: 0;
  color: #818981;
  font-size: 0.72rem;
}

/* Date picker */

.date-picker-popover {
  position: fixed;
  z-index: 200;
  width: min(340px, calc(100vw - 24px));
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(17, 29, 22, 0.22);
}

.date-picker-head {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-picker-title {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  text-transform: capitalize;
}

.date-picker-nav {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: #f5f7f3;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.date-picker-nav:hover {
  background: var(--lime);
}

.date-picker-nav svg {
  width: 15px;
  height: 15px;
}

.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-picker-weekdays {
  margin-bottom: 5px;
}

.date-picker-weekdays span {
  padding: 5px 0;
  color: #929992;
  font-size: 0.63rem;
  font-weight: 800;
  text-align: center;
}

.date-cell,
.month-cell,
.year-cell {
  min-height: 36px;
  padding: 6px;
  color: #4f5850;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
}

.date-cell {
  aspect-ratio: 1;
}

.date-cell.outside {
  color: #c0c5c0;
}

.date-cell.today,
.month-cell.today {
  border-color: #b7c3af;
}

.date-cell:hover,
.month-cell:hover,
.year-cell:hover {
  color: var(--forest);
  background: #e8f3ff;
}

.date-cell.selected,
.month-cell.selected,
.year-cell.selected {
  color: var(--forest);
  background: var(--lime);
  border-color: var(--lime-strong);
  font-weight: 800;
}

.date-picker-years {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 3px 0 9px;
  scrollbar-width: thin;
}

.year-cell {
  flex: 0 0 auto;
  min-height: 31px;
  padding-inline: 10px;
  font-size: 0.69rem;
}

.date-picker-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.month-cell {
  text-transform: capitalize;
}

.date-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.date-picker-link {
  min-height: 34px;
  padding: 7px 10px;
  color: #0b5fcc;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 750;
}

.date-picker-link:hover {
  background: #e8f3ff;
}

/* Dialog and toast */

.detail-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}

.detail-dialog::backdrop {
  background: rgba(8, 15, 11, 0.64);
  backdrop-filter: blur(6px);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.dialog-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
}

.detail-item {
  min-width: 0;
  padding: 15px;
  background: #f6f8f4;
  border: 1px solid #e0e5dd;
  border-radius: 15px;
}

.detail-item.wide {
  grid-column: span 2;
}

.detail-item p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 16px;
  color: #fff;
  background: var(--forest);
  border: 1px solid rgba(45, 140, 255, 0.28);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Blue chrome theme
   Azul transmite precisão e segurança; prata marca superfícies premium.
   O metal é construído com múltiplos níveis de luz, sombra e reflexo móvel. */

@keyframes chrome-sweep {
  0%,
  64% {
    transform: translateX(-170%) skewX(-18deg);
  }
  100% {
    transform: translateX(220%) skewX(-18deg);
  }
}

.sidebar {
  background:
    radial-gradient(circle at 18% 7%, rgba(45, 140, 255, 0.26), transparent 18rem),
    linear-gradient(180deg, #09203d 0%, #061427 58%, #040f1e 100%);
  border-right-color: rgba(215, 225, 235, 0.18);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.06);
}

.brand-mark {
  color: #073468;
  background-color: #929ba3;
  background-image:
    linear-gradient(135deg, rgba(237, 241, 244, 0.18), rgba(48, 55, 62, 0.2)),
    url("assets/silver-satin.webp");
  background-position: center, 48% 48%;
  background-size: cover;
  border: 1px solid #c9d0d7;
  box-shadow:
    inset 0 1px 0 #e8edf1,
    inset 0 -2px 0 #525e69,
    0 15px 32px rgba(0, 8, 20, 0.34);
}

.brand-mark::after,
.nav-item.active::after,
.metric-card:nth-child(2)::before,
.icon-button.subtle::after {
  content: "";
  position: absolute;
  top: -35%;
  bottom: -35%;
  left: 0;
  width: 17%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18) 28%, rgba(255, 255, 255, 0.82) 50%, rgba(255, 255, 255, 0.16) 72%, transparent);
  opacity: 0.48;
  transform: translateX(-170%) skewX(-18deg);
  animation: chrome-sweep 5.8s ease-in-out infinite;
}

.brand-stripes {
  background: repeating-linear-gradient(90deg, #0b5fcc 0 2px, transparent 2px 5px);
}

.brand-name {
  color: #dce8f4;
}

.nav-caption {
  color: #71869a;
}

.nav-item {
  color: #91a4b7;
}

.nav-item:hover {
  color: #fff;
  background: rgba(108, 171, 246, 0.1);
}

.nav-item.active {
  overflow: hidden;
  color: #072650;
  background-color: #929ba3;
  background-image:
    linear-gradient(105deg, rgba(239, 242, 244, 0.42), rgba(112, 119, 126, 0.24)),
    url("assets/silver-satin.webp");
  background-position: center, 52% 48%;
  background-size: cover;
  border-color: #c9d1d8;
  box-shadow:
    inset 0 1px 0 #e6ebef,
    inset 0 -2px 0 #596570,
    0 13px 28px rgba(0, 10, 25, 0.3);
}

.status-dot {
  background: #4da3ff;
  box-shadow: 0 0 0 5px rgba(77, 163, 255, 0.14), 0 0 16px rgba(77, 163, 255, 0.72);
}

.sidebar-footer {
  background: linear-gradient(145deg, rgba(184, 204, 223, 0.1), rgba(35, 76, 119, 0.08));
  border-color: rgba(205, 220, 234, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-footer small {
  color: #7f94a8;
}

.topbar {
  background:
    radial-gradient(circle at 82% 12%, rgba(81, 163, 255, 0.42), transparent 24rem),
    linear-gradient(118deg, #06172d 0%, #0a315f 54%, #0758ae 100%);
  border-color: rgba(223, 235, 246, 0.34);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.19),
    inset 0 -1px rgba(0, 10, 27, 0.42),
    0 25px 70px rgba(4, 31, 65, 0.25);
}

.topbar::before {
  border-color: rgba(225, 237, 248, 0.24);
  box-shadow:
    0 0 0 42px rgba(184, 212, 240, 0.055),
    0 0 0 86px rgba(184, 212, 240, 0.035),
    inset 0 0 0 64px rgba(255, 255, 255, 0.025);
}

.topbar::after {
  color: transparent;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(232, 241, 250, 0.09), rgba(255, 255, 255, 0.012));
  background-clip: text;
  -webkit-background-clip: text;
}

.topbar .eyebrow {
  color: #d4e1ed;
}

.topbar-summary {
  color: #b8cadb;
}

.icon-button {
  position: relative;
  overflow: hidden;
}

.icon-button.primary {
  color: #fff;
  background: linear-gradient(145deg, #1478e8, #084d9f);
  border-color: #4da3ff;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    inset 0 -1px rgba(0, 20, 57, 0.55),
    0 14px 30px rgba(0, 48, 111, 0.3);
}

.icon-button.primary:hover {
  background: linear-gradient(145deg, #2b91ff, #0757b6);
  border-color: #8bc6ff;
}

.icon-button.subtle,
.topbar .icon-button.subtle {
  color: #0b315f;
  background-color: #929ba3;
  background-image:
    linear-gradient(105deg, rgba(244, 246, 247, 0.5), rgba(169, 175, 181, 0.34)),
    url("assets/silver-satin.webp");
  background-position: center, 50% 54%;
  background-size: cover;
  border-color: #c8d0d7;
  box-shadow:
    inset 0 1px 0 #e7ebef,
    inset 0 -2px 0 #59646f,
    0 10px 22px rgba(4, 25, 52, 0.24);
  text-shadow: 0 1px rgba(255, 255, 255, 0.72);
}

.icon-button.subtle:hover,
.topbar .icon-button.subtle:hover,
.icon-only.ghost:hover,
.text-button:hover {
  color: #062a58;
  background-color: #a0a8ae;
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0.32), rgba(67, 74, 81, 0.08)),
    url("assets/silver-satin.webp");
  background-position: center, 50% 47%;
  background-size: cover;
  border-color: #d9dfe4;
}

.icon-button.subtle::after {
  animation-duration: 4.8s;
}

.import-dropzone.is-dragging {
  color: #fff !important;
  background: linear-gradient(145deg, #258aff, #0752a7) !important;
  border-color: #a8d4ff !important;
}

.label,
.eyebrow,
.panel .label,
.report-heading .label {
  color: #0b5fcc;
}

.metric-card {
  border-color: rgba(36, 68, 100, 0.13);
  box-shadow: 0 11px 28px rgba(7, 35, 68, 0.09);
}

.metric-card:nth-child(1) {
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(112, 190, 255, 0.48), transparent 9rem),
    linear-gradient(145deg, #0c69d7, #063d82);
  border-color: #56a6f5;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    0 16px 34px rgba(5, 66, 137, 0.24);
}

.metric-card:nth-child(1) .label,
.metric-card:nth-child(1) .metric-note {
  color: #d8eaff;
}

.metric-card:nth-child(1) .metric-icon {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.metric-card:nth-child(2) {
  overflow: hidden;
  color: #07182e;
  background-color: #8c969e;
  background-image:
    linear-gradient(112deg, rgba(245, 247, 248, 0.48), rgba(196, 201, 205, 0.3) 52%, rgba(112, 119, 125, 0.24)),
    url("assets/silver-satin.webp");
  background-position: center, 44% 51%;
  background-size: cover;
  border-color: #c7cfd6;
  box-shadow:
    inset 0 1px 0 #e6ebef,
    inset 0 -2px 0 #4f5a65,
    0 16px 36px rgba(22, 40, 59, 0.25);
  text-shadow: 0 1px rgba(255, 255, 255, 0.42);
}

.metric-card:nth-child(2)::before {
  z-index: 0;
  width: 16%;
  opacity: 0.38;
}

.metric-card:nth-child(2) .label,
.metric-card:nth-child(2) .metric-note {
  color: #162638;
  font-weight: 600;
  text-shadow: 0 1px rgba(255, 255, 255, 0.68);
}

.metric-card:nth-child(3) {
  background: linear-gradient(145deg, #ffffff, #edf3f8);
  border-color: #fff;
}

.metric-card:nth-child(4) {
  color: #fff;
  background:
    radial-gradient(circle at 88% 14%, rgba(46, 131, 225, 0.3), transparent 10rem),
    linear-gradient(145deg, #102f55, #07172c);
  border-color: #294d76;
}

.metric-card:nth-child(4) .label,
.metric-card:nth-child(4) .metric-note {
  color: #b8c9da;
}

.metric-card:nth-child(4) .metric-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.panel {
  background: rgba(251, 253, 255, 0.94);
  border-color: rgba(56, 83, 110, 0.14);
  box-shadow: 0 10px 28px rgba(7, 35, 68, 0.075);
}

input,
select,
textarea,
.select-trigger {
  background: #f5f8fb;
  border-color: #d2dbe4;
}

input:focus,
textarea:focus,
.select-control.open .select-trigger,
.date-control.open input {
  background: #fff;
  border-color: #2d8cff;
  box-shadow: 0 0 0 4px rgba(45, 140, 255, 0.14);
}

.select-option:hover,
.select-option.active {
  color: #082d5a;
  background: #e7f2ff;
}

.select-option.active::before {
  background: #1478e8;
}

.upload-box {
  background: #f2f6fa;
  border-color: #bfcbd6;
}

.upload-box:hover,
.upload-box.has-file,
.upload-box.is-dragging {
  color: #082d5a;
  background: rgba(45, 140, 255, 0.11);
  border-color: #2d8cff;
}

.trend-panel {
  background:
    radial-gradient(circle at 88% 10%, rgba(82, 169, 255, 0.3), transparent 15rem),
    linear-gradient(155deg, #092747, #041426 70%);
  border-color: rgba(186, 213, 239, 0.19);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 24px 58px rgba(6, 28, 53, 0.22);
}

.trend-panel .label {
  color: #8bc6ff;
}

.trend-panel .empty-state::before {
  background-color: #8c969e;
  background-image:
    linear-gradient(145deg, transparent 46%, rgba(255, 255, 255, 0.86) 47% 49%, transparent 50%),
    url("assets/silver-satin.webp");
  background-position: center;
  background-size: cover;
  border-color: #c7d0d8;
  box-shadow: inset 0 1px #e8edf1, inset 0 -2px #505c67, 0 0 24px rgba(84, 169, 255, 0.18);
}

.trend-panel .bar-fill {
  background-color: #8c969e;
  background-image:
    linear-gradient(90deg, rgba(238, 241, 243, 0.18), rgba(61, 68, 75, 0.12)),
    url("assets/silver-satin.webp");
  background-position: center;
  background-size: cover;
}

.bar-fill {
  background: linear-gradient(90deg, #0759ba, #3a9cff);
}

th {
  color: #68798a;
  background: #eef3f7;
}

tbody tr:hover {
  background: #f3f8fd;
}

.status-pill {
  color: #1259a6;
  background: #e6f1fc;
  border-color: #c2d9ef;
}

.status-pill.recebida {
  color: #0d5fae;
  background: #e3f1ff;
  border-color: #bbd9f7;
}

.mini-action:hover {
  color: #fff;
  background: linear-gradient(145deg, #258aff, #0752a7);
  border-color: #68b2ff;
}

.date-cell:hover,
.month-cell:hover,
.year-cell:hover {
  color: #082d5a;
  background: #e8f3ff;
}

.date-cell.selected,
.month-cell.selected,
.year-cell.selected {
  color: #fff;
  background: linear-gradient(145deg, #2388f7, #0754ad);
  border-color: #65b1ff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3);
}

.date-picker-link,
.text-button {
  color: #0b5fcc;
}

.date-picker-link:hover {
  background: #e8f3ff;
}

.detail-item {
  background: #f1f5f9;
  border-color: #d7e0e8;
}

.toast {
  background: linear-gradient(145deg, #0b315f, #06172c);
  border-color: rgba(150, 203, 255, 0.48);
  box-shadow: 0 20px 55px rgba(4, 28, 58, 0.34);
}

/* Responsive */

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .workspace-grid,
  .report-grid,
  .message-grid {
    grid-template-columns: 1fr;
  }

  .trend-panel {
    min-height: 360px;
  }
}

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

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

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 100;
    display: block;
    width: auto;
    height: 72px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 21px;
    box-shadow: 0 18px 50px rgba(7, 13, 9, 0.35);
  }

  .brand-block,
  .nav-caption,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    height: 100%;
    margin: 0;
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: 100%;
    min-height: 0;
    padding: 5px;
    font-size: 0.59rem;
    text-align: center;
  }

  .nav-item span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .main-content {
    padding: 16px 16px 112px;
  }

  .topbar {
    min-height: 232px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-copy,
  .topbar-actions {
    width: 100%;
  }

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

@media (max-width: 680px) {
  .main-content {
    padding-inline: 10px;
  }

  .topbar {
    min-height: 286px;
    padding: 23px 19px 20px;
    border-radius: 24px;
  }

  .topbar::before {
    right: -130px;
  }

  .topbar h2 {
    font-size: clamp(2.4rem, 13vw, 3.6rem);
  }

  .topbar-summary {
    max-width: 92%;
    font-size: 0.82rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .primary {
    flex: 1 1 auto;
  }

  .topbar-actions .icon-button.subtle span {
    display: none;
  }

  .metric-grid,
  .filter-panel,
  .billing-form,
  .upload-row,
  .message-fields,
  .dialog-content {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 150px;
  }

  .span-2,
  .message-fields .field:last-child,
  .detail-item.wide {
    grid-column: span 1;
  }

  .panel-heading,
  .report-heading {
    align-items: flex-start;
    padding: 18px;
  }

  .billing-form,
  .message-workspace,
  .message-output,
  .summary-list,
  .bar-chart {
    padding-right: 18px;
    padding-left: 18px;
  }

  .bar-row {
    grid-template-columns: 50px minmax(70px, 1fr) 82px;
    gap: 8px;
  }

  .bar-value {
    font-size: 0.65rem;
  }

  .report-heading {
    flex-direction: column;
  }

  .report-heading .compact-field {
    width: 100%;
  }

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

  .dialog-actions .icon-button {
    flex: 1;
  }

  .select-menu {
    max-height: 210px;
  }

  .toast {
    right: 16px;
    bottom: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Editorial workspace layout v2
   A estrutura deixa de ser um dashboard com sidebar e passa a funcionar
   como um workspace horizontal, inspirado no ritmo das referências. */

@media (min-width: 861px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: minmax(190px, 0.7fr) minmax(520px, 1.7fr) minmax(220px, 0.75fr);
    align-items: center;
    gap: 22px;
    width: 100%;
    height: 88px;
    padding: 12px 30px;
    border-right: 0;
    border-bottom: 1px solid rgba(215, 225, 235, 0.18);
    box-shadow:
      inset 0 -1px rgba(255, 255, 255, 0.04),
      0 14px 38px rgba(3, 18, 36, 0.2);
  }

  .brand-block {
    min-height: 0;
    padding: 0;
    border-bottom: 0;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .brand-block h1 {
    font-size: 1rem;
  }

  .nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
  }

  .nav-caption {
    display: none;
  }

  .nav-item {
    justify-content: center;
    width: auto;
    min-width: 118px;
    padding: 10px 14px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: grid;
    align-content: center;
    min-width: 0;
    min-height: 58px;
    margin: 0;
    padding: 9px 13px;
    border-radius: 16px;
  }

  .sidebar-footer-heading {
    gap: 7px;
  }

  .sidebar-footer p:last-of-type {
    margin: 4px 0 0;
    overflow: hidden;
    font-size: 0.69rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-footer small {
    display: none;
  }

  .main-content {
    max-width: 1500px;
    padding: 24px 32px 68px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    align-items: end;
    min-height: 260px;
    padding: 38px 38px 34px;
    border-radius: 34px;
  }

  .topbar-copy {
    max-width: 900px;
  }

  .topbar h2 {
    font-size: clamp(3.35rem, 5.4vw, 6rem);
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }

  .topbar-actions .icon-button {
    width: 100%;
  }

  #newBillingButton {
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .metric-card,
  .panel {
    border-radius: 30px;
  }

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

  .trend-panel {
    order: -1;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 280px;
    overflow: hidden;
  }

  .trend-panel .panel-heading {
    align-items: flex-end;
    padding: 30px;
    border-right: 1px solid rgba(255, 255, 255, 0.11);
    border-bottom: 0;
  }

  .trend-panel h3 {
    max-width: 180px;
    font-size: clamp(2rem, 3.2vw, 3.35rem);
    line-height: 0.95;
  }

  .trend-panel .bar-chart {
    align-content: center;
    min-height: 280px;
    padding: 28px 32px;
  }

  .trend-panel .empty-state {
    min-height: 220px;
  }

  .form-panel > .panel-heading,
  .table-panel > .panel-heading,
  .report-heading {
    padding: 25px 28px;
  }

  .billing-form {
    padding: 28px;
  }

  .table-panel {
    margin-top: 20px;
  }
}

@media (min-width: 1101px) {
  .metric-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }

  .metric-card {
    min-height: 190px;
  }

  .metric-card:nth-child(1) {
    grid-column: span 4;
  }

  .metric-card:nth-child(2) {
    grid-column: span 3;
  }

  .metric-card:nth-child(3) {
    grid-column: span 3;
  }

  .metric-card:nth-child(4) {
    grid-column: span 2;
  }

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

@media (min-width: 861px) and (max-width: 1199px) {
  .sidebar {
    grid-template-columns: minmax(160px, 0.55fr) minmax(0, 1.8fr);
    padding-inline: 22px;
  }

  .sidebar-footer {
    display: none;
  }

  .nav-item {
    flex: 1;
    min-width: 0;
  }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 861px) and (max-width: 980px) {
  .sidebar {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .brand-copy {
    display: none;
  }

  .nav-item {
    padding-inline: 9px;
    font-size: 0.75rem;
  }

  .main-content {
    padding-inline: 22px;
  }

  .topbar {
    grid-template-columns: 1fr 300px;
    padding-inline: 28px;
  }
}

/* Sunlit water palette
   Jet Black #1f2e37 | Blue Slate #5c727b | Sunlit Clay #f2b968 */

body {
  background: radial-gradient(circle at 84% 7%, rgba(242, 185, 104, 0.2), transparent 26rem), linear-gradient(135deg, var(--canvas-warm), var(--canvas));
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: rgba(242, 185, 104, 0.62); }
::selection { color: #1f2e37; background: #f2b968; }

.sidebar {
  background: radial-gradient(circle at 18% 7%, rgba(242, 185, 104, 0.18), transparent 18rem), linear-gradient(180deg, #263942 0%, #1f2e37 62%, #17242b 100%);
  border-color: rgba(242, 185, 104, 0.24);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.05), 0 14px 38px rgba(31, 46, 55, 0.24);
}

.brand-mark {
  color: #1f2e37;
  background: linear-gradient(145deg, #f8ce92, #f2b968 55%, #d69a45);
  border-color: #ffd99f;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.52), inset 0 -2px rgba(125, 78, 18, 0.28), 0 15px 32px rgba(15, 25, 30, 0.32);
}

.brand-stripes { background: repeating-linear-gradient(90deg, #1f2e37 0 2px, transparent 2px 5px); }
.brand-name, .label, .eyebrow, .panel .label, .report-heading .label { color: #d99b43; }
.nav-caption, .sidebar-footer small { color: #8fa1a8; }
.nav-item { color: #bdc8cc; }
.nav-item:hover { color: #fff; background: rgba(242, 185, 104, 0.12); }

.nav-item.active {
  color: #1f2e37;
  background: linear-gradient(135deg, #f8ce92, #f2b968 58%, #d69a45);
  border-color: #ffd99f;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45), inset 0 -2px rgba(125, 78, 18, 0.24), 0 13px 28px rgba(15, 25, 30, 0.3);
}

.status-dot { background: #f2b968; box-shadow: 0 0 0 5px rgba(242, 185, 104, 0.14), 0 0 16px rgba(242, 185, 104, 0.62); }
.sidebar-footer { background: linear-gradient(145deg, rgba(92, 114, 123, 0.2), rgba(242, 185, 104, 0.07)); border-color: rgba(242, 185, 104, 0.2); }

.topbar {
  background: radial-gradient(circle at 82% 12%, rgba(242, 185, 104, 0.42), transparent 24rem), linear-gradient(118deg, #1f2e37 0%, #405862 56%, #5c727b 100%);
  border-color: rgba(242, 185, 104, 0.38);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), inset 0 -1px rgba(18, 29, 35, 0.38), 0 25px 70px rgba(31, 46, 55, 0.24);
}

.topbar::before { border-color: rgba(242, 185, 104, 0.28); box-shadow: 0 0 0 42px rgba(242, 185, 104, 0.065), 0 0 0 86px rgba(242, 185, 104, 0.035), inset 0 0 0 64px rgba(255, 255, 255, 0.025); }
.topbar::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(242, 185, 104, 0.11), rgba(255, 255, 255, 0.012)); background-clip: text; -webkit-background-clip: text; }
.topbar .eyebrow, .topbar-summary { color: #e7edf0; }

.icon-button.primary {
  color: #1f2e37;
  background: linear-gradient(145deg, #f8cc8d, #f2b968 58%, #d69a45);
  border-color: #ffd99f;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.48), inset 0 -1px rgba(125, 78, 18, 0.34), 0 14px 30px rgba(83, 55, 20, 0.25);
}

.icon-button.primary:hover { background: linear-gradient(145deg, #ffd99f, #f4c178 58%, #dc9f49); border-color: #ffe4b9; }

.icon-button.subtle, .topbar .icon-button.subtle {
  color: #fff;
  background: rgba(31, 46, 55, 0.46);
  border-color: rgba(242, 185, 104, 0.35);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 10px 22px rgba(31, 46, 55, 0.2);
  text-shadow: none;
}

.icon-button.subtle:hover, .topbar .icon-button.subtle:hover, .icon-only.ghost:hover, .text-button:hover { color: #1f2e37; background: #f2b968; border-color: #ffd99f; }
.import-dropzone.is-dragging { color: #1f2e37 !important; background: #f2b968 !important; border-color: #ffd99f !important; }

.metric-card { border-color: rgba(92, 114, 123, 0.18); box-shadow: 0 11px 28px rgba(31, 46, 55, 0.1); }
.metric-card:nth-child(1) { color: #1f2e37; background: radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.42), transparent 9rem), linear-gradient(145deg, #f6c984, #f2b968 62%, #d99b43); border-color: #f8cf94; box-shadow: inset 0 1px rgba(255, 255, 255, 0.35), 0 16px 34px rgba(145, 94, 27, 0.18); }
.metric-card:nth-child(1) .label, .metric-card:nth-child(1) .metric-note { color: #513916; }
.metric-card:nth-child(1) .metric-icon { background: rgba(255, 255, 255, 0.24); border-color: rgba(31, 46, 55, 0.18); }
.metric-card:nth-child(2) { color: #fff; background: linear-gradient(145deg, #6f858e, #5c727b 58%, #465b64); border-color: #8799a0; box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), inset 0 -2px rgba(31, 46, 55, 0.28), 0 16px 36px rgba(31, 46, 55, 0.22); text-shadow: none; }
.metric-card:nth-child(2) .label, .metric-card:nth-child(2) .metric-note { color: #eef2f3; text-shadow: none; }
.metric-card:nth-child(3) { background: linear-gradient(145deg, #fffdfa, #f5f0e7); border-color: #f3dfc1; }
.metric-card:nth-child(4) { color: #fff; background: radial-gradient(circle at 88% 14%, rgba(242, 185, 104, 0.22), transparent 10rem), linear-gradient(145deg, #30434d, #1f2e37); border-color: #5c727b; }
.metric-card:nth-child(4) .label, .metric-card:nth-child(4) .metric-note { color: #d9e0e3; }

.panel { background: rgba(255, 253, 250, 0.95); border-color: rgba(92, 114, 123, 0.17); box-shadow: 0 10px 28px rgba(31, 46, 55, 0.08); }
input, select, textarea, .select-trigger { background: #f5f7f6; border-color: #d0dadd; }
input:focus, textarea:focus, .select-control.open .select-trigger, .date-control.open input { background: #fff; border-color: #f2b968; box-shadow: 0 0 0 4px rgba(242, 185, 104, 0.2); }
.select-option:hover, .select-option.active, .date-cell:hover, .month-cell:hover, .year-cell:hover, .date-picker-link:hover { color: #1f2e37; background: #fcebd2; }
.select-option.active::before { background: #f2b968; }
.upload-box { background: #f2f5f5; border-color: #b9c6ca; }
.upload-box:hover, .upload-box.has-file, .upload-box.is-dragging { color: #1f2e37; background: rgba(242, 185, 104, 0.18); border-color: #f2b968; }

.trend-panel { background: radial-gradient(circle at 88% 10%, rgba(242, 185, 104, 0.3), transparent 15rem), linear-gradient(155deg, #30464f, #1f2e37 70%); border-color: rgba(242, 185, 104, 0.24); box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 24px 58px rgba(31, 46, 55, 0.24); }
.trend-panel .label { color: #f2b968; }
.trend-panel .empty-state::before, .trend-panel .bar-fill, .bar-fill { background: linear-gradient(90deg, #d99b43, #f2b968); border-color: #f8cf94; box-shadow: 0 0 24px rgba(242, 185, 104, 0.2); }

th { color: #536871; background: #edf1f2; }
tbody tr:hover { background: #fcf5e9; }
.status-pill, .status-pill.recebida { color: #3f555d; background: #e6ecee; border-color: #c3cfd3; }
.mini-action:hover, .date-cell.selected, .month-cell.selected, .year-cell.selected { color: #1f2e37; background: #f2b968; border-color: #f8cf94; box-shadow: inset 0 1px rgba(255, 255, 255, 0.35); }
.date-picker-link, .text-button { color: #9d671c; }
.detail-item { background: #f3f5f4; border-color: #d5dddf; }
.toast { background: linear-gradient(145deg, #405761, #1f2e37); border-color: rgba(242, 185, 104, 0.52); box-shadow: 0 20px 55px rgba(31, 46, 55, 0.36); }

/* Workflow, recebimentos e auditoria */
.cell-meta {
  display: block;
  margin-top: 4px;
  color: #85949a;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.cell-meta.overdue {
  color: var(--danger);
}

.status-pill.nao-faturado,
.status-pill.aguardando-nf {
  color: #7a591f;
  background: #fff3dd;
  border-color: #eccf99;
}

.status-pill.boleto-enviado {
  color: #2f5f79;
  background: #e8f2f7;
  border-color: #bfd6e2;
}

.status-pill.vencida {
  color: #9f332a;
  background: #fbe9e6;
  border-color: #edc2bc;
}

.status-pill.recebida {
  color: #346653;
  background: #e5f2ec;
  border-color: #bdd8cc;
}

.receive-action {
  color: #346653;
  background: #edf6f1;
  border-color: #c8ddd4;
}

.compact-dialog {
  width: min(590px, calc(100vw - 28px));
}

.dialog-content > .field.wide {
  grid-column: span 2;
}

.history-empty {
  color: var(--soft);
  font-size: 0.72rem;
}

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

.history-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.history-list li:last-child {
  border-bottom: 0;
}

.history-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--lime);
  border-radius: 50%;
}

.history-list strong,
.history-list small,
.history-list time {
  display: block;
}

.history-list small,
.history-list time {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.65rem;
}

.history-list time {
  text-align: right;
  white-space: nowrap;
}
