:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #eef4f2;
  --text: #18201d;
  --muted: #64706b;
  --line: #d9e0dc;
  --primary: #176b5d;
  --primary-strong: #0d4f45;
  --primary-soft: #dceee9;
  --danger: #bc4236;
  --danger-soft: #f8e1dd;
  --warn: #a76516;
  --warn-soft: #f7ead2;
  --blue: #315f99;
  --shadow: 0 16px 40px rgba(23, 39, 34, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #10231f;
  color: #f7fbf9;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #92d3c3;
  color: #10231f;
  font-weight: 800;
}

.brand small {
  display: block;
  color: #aac0b9;
  margin-top: 2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: transparent;
  color: #dce8e4;
  text-align: left;
}

.nav-item svg,
.button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-alert-badge {
  min-width: 24px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 11px;
  color: #08271f;
  background: #9de1d2;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}

.nav-alert-badge.danger {
  color: #fff;
  background: #d44335;
}

.pending-command-center {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid #d5aa5d;
  border-left: 7px solid #c88016;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 252, 244, 0.98), rgba(248, 238, 215, 0.9)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
  box-shadow: 0 14px 34px rgba(91, 65, 24, 0.12);
}

.pending-command-center.has-risk {
  border-color: #dc8a80;
  border-left-color: var(--danger);
  background:
    linear-gradient(110deg, rgba(255, 250, 249, 0.98), rgba(248, 225, 221, 0.92)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.pending-command-center.all-clear {
  border-color: #8cc8b9;
  border-left-color: var(--primary);
  background: linear-gradient(110deg, rgba(249, 255, 253, 0.98), rgba(220, 238, 233, 0.9));
}

.pending-command-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 14px;
}

.pending-command-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: #c88016;
  font-size: 1.45rem;
  font-weight: 900;
}

.has-risk .pending-command-icon {
  background: var(--danger);
}

.all-clear .pending-command-icon {
  background: var(--primary);
}

.pending-command-kicker {
  color: #89510c;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.has-risk .pending-command-kicker {
  color: var(--danger);
}

.pending-command-head h3 {
  margin: 2px 0 3px;
  font-size: 1.15rem;
}

.pending-command-head p {
  margin: 0;
  color: var(--muted);
}

.pending-command-button {
  border-color: #aa6e18;
  color: #6f430b;
  background: rgba(255, 255, 255, 0.75);
}

.pending-command-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid rgba(128, 103, 64, 0.18);
  background: rgba(255, 255, 255, 0.48);
}

.pending-command-stats > div {
  padding: 14px 20px;
  border-right: 1px solid rgba(128, 103, 64, 0.15);
}

.pending-command-stats > div:last-child {
  border-right: 0;
}

.pending-command-stats span,
.pending-command-stats small {
  display: block;
  color: var(--muted);
}

.pending-command-stats strong {
  display: block;
  margin: 4px 0 2px;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  white-space: nowrap;
}

.pending-command-stats .overdue-stat strong {
  color: var(--danger);
}

.dashboard-pending-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: rgba(128, 103, 64, 0.14);
}

.dashboard-pending-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 16px;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.91);
  text-align: left;
  cursor: pointer;
}

.dashboard-pending-item:hover {
  background: #fff;
}

.pending-urgency-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.dashboard-pending-item.overdue .pending-urgency-dot {
  background: var(--danger);
}

.dashboard-pending-item.today .pending-urgency-dot {
  background: var(--warn);
}

.dashboard-pending-meta,
.dashboard-pending-date {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-pending-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-pending-meta small,
.dashboard-pending-date small {
  color: var(--muted);
}

.dashboard-pending-date {
  text-align: right;
}

.pending-command-empty {
  grid-column: 1 / -1;
  padding: 15px 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
}

.content {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-heading,
.panel-title,
.panel-actions,
.topbar-actions,
.filter-row,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.period-control {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.period-control label,
.month-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.period-control select,
.period-control input {
  min-width: 132px;
}

.period-control .hidden {
  display: none;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
}

input[readonly] {
  background: #eef4f2;
  color: var(--muted);
}

textarea {
  resize: vertical;
}

.button,
.link-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 750;
}

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

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

.button.ghost,
.link-button {
  background: transparent;
}

.link-button {
  border: 0;
  color: var(--primary);
  font-weight: 800;
  padding: 6px 0;
}

.panel-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-actions select {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric,
.mini-metric,
.panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric,
.mini-metric {
  position: relative;
  padding: 18px;
}

.mini-metric:has(.mood-emoji) {
  padding-right: 70px;
}

.metric span,
.metric small,
.mini-metric span,
.mini-metric small,
.panel-title span,
.muted {
  color: var(--muted);
}

.metric strong,
.mini-metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.metric strong {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.mini-metric strong {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.metric.danger,
.mini-metric.danger {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 225, 221, 0.86)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.metric.warn,
.mini-metric.warn {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 234, 210, 0.86)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.mini-metric.danger {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 225, 221, 0.86)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.mini-metric.positive-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(220, 238, 233, 0.86)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.mood-emoji {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 32, 29, 0.1);
  font-size: 1.85rem;
  box-shadow: 0 8px 20px rgba(23, 39, 34, 0.08);
}

.current-panel {
  display: grid;
  gap: 16px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-left-stack {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
}

.money-board,
.split-board,
.dashboard-group-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.88)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
  border-radius: 16px;
  border-color: rgba(24, 32, 29, 0.1);
}

.dashboard-group-panel {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.split-board {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.88)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.money-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.money-line {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label icon"
    "value value"
    "meta meta";
  gap: 4px 10px;
  align-items: start;
  min-height: 148px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(24, 32, 29, 0.09);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
  box-shadow: 0 12px 28px rgba(23, 39, 34, 0.08);
  backdrop-filter: blur(3px);
}

.money-line::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 14px 0 0 14px;
  background: var(--primary);
}

.expense-line::before,
.balance-line::before {
  background: var(--danger);
}

.budget-line::before {
  background: var(--warn);
}

.money-line strong {
  grid-area: value;
  display: block;
  color: #050807;
  max-width: 100%;
  font-size: clamp(1.2rem, 1.75vw, 1.65rem);
  line-height: 1.04;
  font-weight: 950;
  letter-spacing: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
  margin-top: 10px;
}

.balance-line strong {
  font-size: clamp(1.08rem, 1.55vw, 1.5rem);
}

.money-line span:not(.money-icon, .money-symbol) {
  grid-area: label;
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.money-line small {
  grid-area: meta;
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.74rem;
}

.money-icon,
.money-symbol {
  display: grid;
  place-items: center;
  grid-area: icon;
  color: #050807;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(23, 107, 93, 0.1);
}

.money-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.money-symbol {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 500;
}

.money-symbol.small {
  font-size: 1.45rem;
  font-weight: 900;
}

.budget-line {
  opacity: 1;
}

.budget-line strong {
  font-size: clamp(1.2rem, 1.75vw, 1.65rem);
}

.budget-line span:not(.money-icon, .money-symbol),
.budget-line small {
  font-size: 0.74rem;
}

.summary-pending-line {
  grid-column: 1 / -1;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: none;
  align-items: center;
  min-height: 128px;
  border-color: rgba(167, 101, 22, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 234, 210, 0.84)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
}

.summary-pending-line::before {
  background: var(--warn);
}

.summary-pending-line > .money-symbol {
  grid-area: auto;
  width: 42px;
  height: 42px;
  color: #7b490d;
  background: rgba(167, 101, 22, 0.12);
}

.summary-pending-line > div {
  min-width: 0;
}

.summary-pending-line strong {
  margin: 6px 0;
  color: #7b490d;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  white-space: nowrap;
}

.summary-pending-line span:not(.money-symbol) {
  color: #7b490d;
  font-size: 0.88rem;
  font-weight: 900;
}

.summary-pending-line small {
  font-size: 0.82rem;
  font-weight: 700;
}

.split-board {
  padding: 18px;
}

.split-board h3,
.dashboard-group-panel h3 {
  color: #050807;
  font-size: 0.95rem;
  font-weight: 950;
  text-transform: uppercase;
}

.split-meter {
  display: flex;
  height: 34px;
  margin: 18px 0 12px;
  border: 2px solid rgba(24, 32, 29, 0.18);
  border-radius: 4px;
  overflow: hidden;
  background: #e9efec;
  box-shadow: inset 0 2px 6px rgba(24, 32, 29, 0.16);
}

.split-meter span {
  display: block;
  min-width: 0;
  transition: width 180ms ease;
}

.split-income {
  background: linear-gradient(180deg, #16d516, #05b805);
}

.split-expense {
  background: linear-gradient(180deg, #ff6064, #f53c42);
}

.split-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: center;
  color: #050807;
}

.split-labels strong {
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  font-weight: 950;
}

.split-labels small {
  color: #050807;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-group-panel {
  min-height: 100%;
}

.dashboard-group-panel .panel-title {
  align-items: baseline;
}

.dashboard-group-panel .panel-title span {
  color: #050807;
  font-size: 0.92rem;
  font-weight: 950;
}

.dashboard-group-panel canvas {
  height: 340px;
  margin-top: 12px;
}

.current-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.featured-balance {
  grid-column: span 2;
  min-height: 152px;
  padding: 24px;
  border: 2px solid rgba(23, 107, 93, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(220, 238, 233, 0.86)),
    url("assets/dashboard-financas.png") center / cover no-repeat;
  box-shadow: 0 18px 42px rgba(23, 107, 93, 0.14);
}

.featured-balance::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 7px 0 0 7px;
  background: var(--primary);
}

.featured-balance > span {
  color: var(--primary-strong);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.featured-balance strong {
  margin: 12px 0 8px;
  color: var(--primary-strong);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  white-space: nowrap;
}

.featured-balance small {
  font-size: 0.86rem;
  font-weight: 700;
}

.analytics-filter-panel {
  box-shadow: none;
  display: grid;
  gap: 12px;
}

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

.slicer-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.slicer-head > div {
  display: grid;
  gap: 2px;
}

.slicer-head strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.slicer-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.slicer-clear {
  min-height: 34px;
  border: 1px solid rgba(22, 122, 95, 0.28);
  border-radius: 4px;
  padding: 0 14px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  cursor: pointer;
}

.slicer-clear.active,
.slicer-clear:hover {
  color: #fff;
  background: var(--primary);
}

.excel-slicer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  max-height: 156px;
  overflow: auto;
  padding: 2px;
  scrollbar-color: var(--primary) #e9efec;
}

.slicer-button {
  min-height: 42px;
  border: 1px solid rgba(22, 122, 95, 0.22);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.slicer-button:hover {
  border-color: var(--primary);
  background: rgba(220, 238, 233, 0.92);
}

.slicer-button.active {
  border-color: var(--primary);
  color: #fff;
  background: linear-gradient(135deg, #0d5f51, #17806c);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16), 0 8px 18px rgba(13, 95, 81, 0.18);
}

.slicer-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slicer-empty {
  color: var(--muted);
  padding: 10px;
}

.slicer-expense-panel {
  margin-top: 14px;
}

.dashboard-grid,
.analytics-grid,
.pending-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

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

.finance-agenda {
  padding: 0;
  overflow: hidden;
}

.finance-agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
}

.finance-agenda-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line);
}

.agenda-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef3f1;
}

.agenda-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.agenda-tabs button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 3px 8px rgba(23, 107, 93, 0.2);
}

.agenda-total {
  display: grid;
  text-align: right;
}

.agenda-total span {
  color: var(--muted);
  font-size: 0.75rem;
}

.agenda-total strong {
  font-size: 1.15rem;
}

.agenda-list {
  display: grid;
}

.agenda-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

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

.agenda-row:hover {
  background: rgba(238, 247, 244, 0.9);
}

.agenda-row-main {
  display: grid;
  grid-template-columns: 48px minmax(200px, 1fr) 120px 130px;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 11px 18px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.agenda-date {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  line-height: 1;
}

.agenda-date strong {
  font-size: 1rem;
}

.agenda-date small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.agenda-description {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agenda-description strong,
.agenda-description small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-description small {
  color: var(--muted);
}

.agenda-status {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.agenda-status.overdue {
  color: var(--danger);
  background: var(--danger-soft);
}

.agenda-status.today,
.agenda-status.soon {
  color: #8b570c;
  background: var(--warn-soft);
}

.agenda-status.paid {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.agenda-amount {
  justify-self: end;
  white-space: nowrap;
}

.agenda-pay-button {
  align-self: center;
  min-height: 34px;
  margin-right: 16px;
  padding: 0 10px;
  border: 1px solid #9cc8bd;
  border-radius: 6px;
  color: var(--primary-strong);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.agenda-pay-button:hover {
  color: #fff;
  background: var(--primary);
}

.agenda-empty {
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 320px;
  margin-top: 16px;
}

.chart-wrap {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid rgba(24, 32, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(23, 39, 34, 0.16);
  color: var(--text);
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 120ms ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip strong {
  font-size: 0.76rem;
  color: var(--muted);
}

.chart-tooltip span {
  font-size: 0.95rem;
  font-weight: 900;
}

.chart-tooltip small {
  color: var(--muted);
}

.compact-list,
.bill-list,
.verocard-list,
.decision-list,
.cashflow-list,
.budget-list,
.budget-editor-grid,
.tag-cloud {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.compact-item,
.bill-item,
.ledger-item,
.cashflow-item,
.decision-item,
.budget-row,
.budget-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.compact-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.signal-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.signal-card span,
.signal-card small {
  color: var(--muted);
}

.signal-card span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-card strong {
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.signal-card.risk {
  border-color: rgba(188, 66, 54, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 225, 221, 0.8));
}

.signal-card.attention {
  border-color: rgba(167, 101, 22, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 234, 210, 0.8));
}

.signal-card.positive {
  border-color: rgba(23, 107, 93, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(220, 238, 233, 0.8));
}

.cashflow-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.cashflow-item small {
  color: var(--muted);
}

.due-alert-panel {
  box-shadow: none;
}

.due-alert-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.due-alert-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.due-alert-item.overdue {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(248, 225, 221, 0.8), rgba(255, 255, 255, 0.9));
}

.due-alert-item.today {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, rgba(247, 234, 210, 0.8), rgba(255, 255, 255, 0.9));
}

.due-alert-date,
.due-alert-meta {
  display: grid;
  gap: 3px;
}

.due-alert-date small,
.due-alert-meta small {
  color: var(--muted);
}

.due-alert-date small {
  font-weight: 800;
}

.alert-settings-card {
  display: grid;
  gap: 12px;
}

.alert-settings-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.evolution-settings {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 244, 242, 0.72);
}

.toggle-control {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
}

.toggle-control input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.alert-settings-actions {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.alert-settings-actions select {
  min-width: 0;
}

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

.bill-item,
.ledger-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.bill-item input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.bill-item.done {
  opacity: 0.72;
}

.bill-item.done strong {
  text-decoration: line-through;
}

.bill-meta,
.ledger-meta {
  display: grid;
  gap: 2px;
}

.bill-meta small,
.ledger-meta small {
  color: var(--muted);
}

.ledger-item {
  grid-template-columns: 1fr auto;
}

.decision-item {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.decision-item strong {
  overflow-wrap: anywhere;
}

.decision-item small {
  color: var(--muted);
}

.decision-item.attention {
  background: var(--warn-soft);
}

.decision-item.risk {
  background: var(--danger-soft);
}

.ledger-running {
  text-align: right;
}

.ledger-running small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.compact-item strong,
.compact-item span {
  overflow-wrap: anywhere;
}

.amount.negative {
  color: var(--danger);
}

.amount.positive {
  color: var(--primary);
}

.budget-row {
  padding: 12px;
}

.budget-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e9efec;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: var(--primary);
}

.progress.over span {
  background: var(--danger);
}

.filter-row {
  flex-wrap: wrap;
}

.filter-row input {
  min-width: min(420px, 100%);
}

.analytics-filter-panel .filter-row {
  align-items: end;
  justify-content: flex-start;
}

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

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

.transaction-search input {
  width: min(420px, 70vw);
}

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

.transaction-summary-grid .mini-metric {
  min-width: 0;
  padding: 16px;
}

.transaction-summary-grid .mini-metric strong {
  white-space: nowrap;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
}

.transaction-table-wrap {
  position: relative;
  max-height: 66vh;
  overflow: auto;
  outline: none;
  scrollbar-color: var(--primary) #e9efec;
}

.transaction-table-wrap:focus-visible {
  box-shadow: inset 0 0 0 2px var(--primary);
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.transaction-table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

.transaction-table-wrap th,
.transaction-table-wrap td {
  border-right: 1px solid rgba(24, 32, 29, 0.09);
  border-bottom: 1px solid rgba(24, 32, 29, 0.11);
}

.transaction-table-wrap th:first-child,
.transaction-table-wrap td:first-child {
  border-left: 1px solid rgba(24, 32, 29, 0.09);
}

.transaction-table-wrap thead th {
  border-top: 1px solid rgba(24, 32, 29, 0.12);
  box-shadow: inset 0 -1px 0 rgba(24, 32, 29, 0.08);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--surface-strong);
}

.transaction-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 8px 10px 14px;
  white-space: nowrap;
}

.excel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.excel-heading button {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #cbd7d2;
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.excel-heading button:hover,
.excel-heading button.sorted {
  border-color: var(--primary);
  color: var(--primary);
}

.excel-heading button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.excel-filter-menu {
  position: fixed;
  z-index: 30;
  width: 300px;
  padding: 12px;
  border: 1px solid #bfcfc8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 45, 38, 0.22);
}

.excel-filter-menu.hidden {
  display: none;
}

.excel-filter-title {
  margin-bottom: 8px;
  font-weight: 800;
}

.excel-sort-option {
  display: block;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  text-align: left;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.excel-sort-option:hover {
  background: var(--primary-soft);
}

.excel-filter-search {
  width: 100%;
  margin: 8px 0;
}

.excel-check-all,
.excel-filter-values label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 0.88rem;
  cursor: pointer;
}

.excel-filter-values {
  max-height: 210px;
  overflow-y: auto;
  border-block: 1px solid var(--line);
}

.excel-filter-values input,
.excel-check-all input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.excel-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
}

.transaction-row {
  cursor: pointer;
}

.transaction-row.row-pending {
  background: rgba(211, 62, 49, 0.1);
}

.transaction-row.row-pending:hover {
  background: rgba(211, 62, 49, 0.17);
}

.transaction-row.row-paid {
  background: rgba(22, 122, 95, 0.1);
}

.transaction-row.row-paid:hover {
  background: rgba(22, 122, 95, 0.17);
}

.transaction-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

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

tbody tr:hover {
  background: #f8faf9;
}

.transaction-table-wrap tbody tr:hover {
  background: inherit;
}

.amount-col,
.actions-col {
  text-align: right;
}

.row-actions {
  display: inline-flex;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.pill.expense {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.status-badge.paid {
  background: rgba(22, 122, 95, 0.16);
  color: #0b6b55;
}

.status-badge.pending {
  background: rgba(211, 62, 49, 0.16);
  color: #b83228;
}

.budget-editor-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.budget-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.budget-card .inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.budget-card .inline input {
  min-width: 0;
  width: 100%;
}

.budget-card .inline .button {
  min-width: 92px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
}

.tag-cloud span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.modal::backdrop {
  background: rgba(11, 22, 19, 0.5);
}

.modal form {
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.modal-actions {
  margin-top: 20px;
}

.modal-actions > div {
  display: flex;
  gap: 10px;
}

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

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(24, 32, 29, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(23, 39, 34, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.danger {
  border-color: rgba(188, 66, 54, 0.35);
  background: linear-gradient(135deg, #fff, #f8e1dd);
}

.app-toast.success {
  border-color: rgba(23, 107, 93, 0.35);
  background: linear-gradient(135deg, #fff, #dceee9);
}

.app-toast strong {
  font-size: 0.92rem;
}

.app-toast span {
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item svg {
    display: none;
  }

  .content {
    padding: 20px;
  }

  .kpi-grid,
  .current-grid,
  .dashboard-main-grid,
  .signal-grid,
  .dashboard-grid,
  .analytics-grid,
  .pending-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .slicer-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .period-control,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list,
  .kpi-grid,
  .current-grid,
  .dashboard-main-grid,
  .signal-grid,
  .dashboard-grid,
  .analytics-grid,
  .pending-grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .money-board {
    grid-template-columns: 1fr;
  }

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

  .pending-command-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pending-command-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pending-command-stats {
    grid-template-columns: 1fr;
  }

  .pending-command-stats > div {
    border-right: 0;
    border-bottom: 1px solid rgba(128, 103, 64, 0.15);
  }

  .finance-agenda-head,
  .agenda-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .agenda-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agenda-total {
    text-align: left;
  }

  .agenda-row {
    grid-template-columns: 1fr;
  }

  .agenda-row-main {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  .agenda-status {
    display: none;
  }

  .agenda-amount {
    grid-column: 3;
    grid-row: 1;
  }

  .agenda-pay-button {
    width: calc(100% - 24px);
    margin: 0 12px 10px;
  }

  .featured-balance {
    grid-column: span 1;
  }

  .money-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .money-line strong {
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .due-alert-item {
    grid-template-columns: 1fr;
  }

  .due-alert-item > .amount {
    text-align: left;
  }

  .dashboard-group-panel canvas {
    height: 360px;
  }

  .nav-item {
    justify-content: flex-start;
  }

  .nav-item svg {
    display: block;
  }

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

  .budget-card .inline {
    grid-template-columns: 1fr;
  }

  .alert-settings-actions {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions > div {
    flex-direction: column-reverse;
  }
}
