:root {
  --bg: #e9edf1;
  --surface: #ffffff;
  --surface-soft: #f7f4ec;
  --text: #2b1816;
  --text-soft: #766862;
  --line: rgba(70, 42, 35, 0.1);
  --primary: #8f1f1d;
  --primary-strong: #b52f26;
  --accent: #d6a847;
  --accent-soft: #fff4d9;
  --success: #17866a;
  --danger: #9e2621;
  --shadow: 0 18px 44px rgba(47, 29, 25, 0.1);
  --shadow-soft: 0 10px 28px rgba(47, 29, 25, 0.08);
  --radius: 26px;
  --radius-sm: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(214, 168, 71, 0.14), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(143, 31, 29, 0.1), transparent 24%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.sys-shell {
  width: min(1180px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 0.75rem 0 2rem;
}

.sys-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding: 1rem;
  color: #fff8ea;
  background:
    linear-gradient(135deg, rgba(143, 31, 29, 0.97), rgba(181, 47, 38, 0.94) 58%, rgba(44, 18, 15, 0.98)),
    url("/imagens/banner_v1.jpg") center/cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sys-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.sys-brand-copy {
  display: grid;
  gap: 0.15rem;
}

.sys-brand img {
  width: 92px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(40, 0, 0, 0.28));
}

.sys-brand strong {
  display: block;
  font-family: Poppins, sans-serif;
  font-size: 1.05rem;
}

.sys-brand span {
  color: rgba(255, 248, 234, 0.76);
  font-size: 0.92rem;
}

.sys-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  flex: 1 1 100%;
  align-items: center;
}

.sys-greeting {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff8ea;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.sys-greeting-wrap {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
}

.sys-greeting-link {
  padding-left: 0.45rem;
  color: rgba(255, 248, 234, 0.74);
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 500;
}

.sys-greeting-link:hover,
.sys-greeting-link:focus-visible {
  color: #fff8ea;
}

.sys-nav a {
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff8ea;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.sys-nav a.sys-nav-logout {
  margin-left: auto;
  background: #fff8ea;
  color: var(--primary);
}

.sys-nav a.sys-nav-logout:hover,
.sys-nav a.sys-nav-logout:focus-visible {
  background: #7f1d1a;
  color: #fff8ea;
}

.sys-main {
  display: grid;
  gap: 1rem;
}

.card,
.sumula-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 1.25rem;
}

.auth-card,
.onboarding-card {
  display: grid;
  gap: 1.25rem;
}

.card-hero {
  display: grid;
  gap: 1rem;
}

.card-heading h1,
.period-heading h2,
.empty-state h2 {
  margin: 0;
  font-family: Poppins, sans-serif;
}

.card-heading p {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.eyebrow::before {
  content: none;
}

.toolbar,
.filters,
.toolbar-actions,
.sumula-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
}

.filters label,
.form-grid label {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  font-weight: 700;
}

.filters label span,
.form-grid label span {
  font-size: 0.92rem;
}

.form-grid label small {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.55;
}

.filters input,
.filters select,
.form-grid input,
.form-grid select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(70, 42, 35, 0.12);
  border-radius: 16px;
  background: #fbfaf7;
  font: inherit;
  color: var(--text);
}

.form-grid select,
.filters select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filters input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  height: 48px;
  min-width: 155px;
  padding: 0.85rem 0.95rem;
}

.form-grid input[type="file"] {
  padding: 0.55rem 0.65rem;
  overflow: hidden;
}

.form-grid input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 14px;
  background: rgba(143, 31, 29, 0.1);
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.form-grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.mode-switch__legend {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 0 0.1rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.mode-switch label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(70, 42, 35, 0.12);
  border-radius: 999px;
  background: #fbfaf7;
  color: var(--text-soft);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.form-grid .mode-switch label {
  grid-column: auto;
}

.mode-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.mode-switch label.is-selected {
  border-color: rgba(143, 31, 29, 0.36);
  background: rgba(143, 31, 29, 0.1);
  color: var(--primary);
}

.mode-switch label.is-selected::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
}

.lancamento-multiplo {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.lancamento-multiplo[hidden] {
  display: none;
}

.lancamento-multiplo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
}

.lancamento-multiplo__head > div {
  display: grid;
  gap: 0.25rem;
}

.lancamento-multiplo__head span {
  font-size: 0.92rem;
  font-weight: 700;
}

.lancamento-multiplo__head small,
.lancamento-checklist small {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.lancamento-repeat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(143, 31, 29, 0.08);
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.lancamento-repeat input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.lancamento-repeat-value {
  margin: 0;
}

.lancamento-checklist td:nth-child(3),
.lancamento-checklist th:nth-child(3) {
  width: 150px;
}

.lancamento-checklist input[type="text"] {
  min-height: 42px;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(70, 42, 35, 0.12);
  border-radius: 12px;
  background: #fbfaf7;
  font: inherit;
}

.lancamento-checklist input[type="text"].is-readonly {
  background: rgba(143, 31, 29, 0.06);
  color: var(--primary);
  font-weight: 800;
}

.rateio-selector {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.rateio-collapse {
  display: grid;
  gap: 1rem;
}

.rateio-collapse summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.rateio-collapse summary::-webkit-details-marker {
  display: none;
}

.rateio-collapse summary .card-heading {
  margin: 0;
}

.rateio-collapse > summary > .rateio-collapse__action {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0.58rem 0.9rem;
  border-radius: 999px;
  background: rgba(143, 31, 29, 0.1);
  color: var(--primary);
  font-size: 0;
  font-weight: 800;
  white-space: nowrap;
}

.rateio-collapse > summary > .rateio-collapse__action::before {
  content: "Expandir";
  font-size: 0.86rem;
}

.rateio-collapse[open] > summary > .rateio-collapse__action::before {
  content: "Recolher";
}

.rateio-selector__label {
  font-weight: 700;
  font-size: 0.92rem;
}

.rateio-checklist {
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(70, 42, 35, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.rateio-checklist table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.rateio-checklist th,
.rateio-checklist td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid rgba(50, 21, 21, 0.11);
  text-align: left;
  vertical-align: middle;
}

.rateio-checklist th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f5f6;
  color: var(--text);
  font-weight: 800;
}

.rateio-checklist th:nth-child(1),
.rateio-checklist td:nth-child(1) {
  width: 58px;
  min-width: 58px;
  padding-left: 1rem;
  padding-right: 0.75rem;
}

.rateio-checklist th:nth-child(2),
.rateio-checklist td:nth-child(2) {
  width: auto;
}

.rateio-checklist th:nth-child(3),
.rateio-checklist td:nth-child(3) {
  width: 150px;
}

.rateio-checklist tr:last-child td {
  border-bottom: 0;
}

.rateio-checklist label {
  display: block;
  gap: 0;
  min-width: 0;
  cursor: pointer;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rateio-checklist__check {
  text-align: center;
}

.rateio-checklist input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff8ea;
  box-shadow: 0 14px 26px rgba(143, 31, 29, 0.18);
}

.button-secondary {
  background: rgba(143, 31, 29, 0.08);
  color: var(--primary);
}

.button-danger {
  background: rgba(158, 38, 33, 0.1);
  color: var(--danger);
}

.support-callout {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239, 201, 109, 0.18), rgba(143, 31, 29, 0.08));
}

.support-callout p,
.onboarding-copy p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.75;
}

.onboarding-card {
  overflow: hidden;
}

.onboarding-copy {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(239, 201, 109, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(143, 31, 29, 0.1), rgba(255, 250, 239, 0.98));
}

.onboarding-copy h1 {
  margin: 0;
  font-family: Poppins, sans-serif;
}

.onboarding-brand {
  margin-top: 0.4rem;
}

.onboarding-brand img {
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(98, 50, 18, 0.14));
}

.gallery-photo-preview {
  width: min(100%, 220px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.gallery-photo-preview img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.alert {
  padding: 1rem 1.2rem;
  border-radius: 18px;
  font-weight: 700;
}

.alert-success {
  background: rgba(29, 123, 91, 0.12);
  color: var(--success);
}

.alert-error {
  background: rgba(158, 38, 33, 0.12);
  color: var(--danger);
}

.sumula-waiting-message {
  border-color: rgba(200, 155, 60, 0.34);
  background:
    linear-gradient(135deg, rgba(239, 201, 109, 0.2), rgba(143, 31, 29, 0.08)),
    var(--surface);
}

.sumula-waiting-message h2 {
  margin: 0 0 0.45rem;
  font-family: Poppins, sans-serif;
}

.sumula-waiting-message p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(143, 31, 29, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.status-chip-subtle {
  min-height: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(50, 21, 21, 0.1);
  background: transparent;
  color: rgba(50, 21, 21, 0.48);
  font-size: 0.76rem;
  font-style: italic;
  font-weight: 500;
}

.period-block {
  display: grid;
  gap: 0.75rem;
}

.period-heading {
  padding-inline: 0.3rem;
}

.sumula-grid {
  display: grid;
  gap: 1rem;
}

.sumula-card {
  display: grid;
  gap: 0.35rem;
}

.sumula-body,
.sumula-actions {
  padding: 1rem 1.1rem;
}

.sumula-body {
  display: grid;
  gap: 0.35rem;
}

.sumula-body span {
  color: var(--text-soft);
}

.empty-state {
  text-align: center;
  padding: 1.3rem;
  border-radius: 20px;
  background: #f7f9fa;
  color: var(--text-soft);
}

.empty-state--compact {
  padding: 0.75rem;
  border: 1px solid rgba(50, 21, 21, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.event-manager {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(50, 21, 21, 0.12);
}

.event-manager summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.event-manager summary::-webkit-details-marker {
  display: none;
}

.event-manager__heading {
  display: grid;
  gap: 0.25rem;
}

.event-manager__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.event-manager__heading h3 {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 1rem;
}

.event-manager__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  background: rgba(143, 31, 29, 0.1);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.event-manager > summary > .event-manager__action {
  display: none;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0.58rem 0.9rem;
  border-radius: 999px;
  background: rgba(143, 31, 29, 0.1);
  color: var(--primary);
  font-size: 0;
  font-weight: 800;
  white-space: nowrap;
}

.event-manager[open] > summary > .event-manager__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.event-manager[open] > summary > .event-manager__action::before {
  content: "Recolher";
  font-size: 0.86rem;
}

.event-manager__heading p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.event-manager__list {
  display: grid;
  gap: 0.75rem;
}

.event-manager__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.75rem;
  border: 1px solid rgba(50, 21, 21, 0.12);
  border-radius: 20px;
  background: #f7f9fa;
}

.event-manager__form {
  align-items: end;
}

.event-manager__form label {
  margin: 0;
}

.event-manager__select,
.event-manager__name {
  grid-column: 1 / -1;
}

.event-manager__form .button {
  width: 100%;
}

.event-manager__delete .button {
  width: 100%;
}

.event-manager__delete {
  display: grid;
}

.athlete-manager {
  display: grid;
  gap: 1rem;
}

.athlete-manager__delete {
  display: grid;
  margin-top: 0.35rem;
}

.athlete-manager__delete .button {
  width: 100%;
}

.finance-grid-sys {
  display: grid;
  gap: 1rem;
}

.finance-grid-sys > .card,
.finance-report,
.card-hero {
  border-radius: var(--radius);
}

.finance-grid-sys > .card {
  min-width: 0;
}

.finance-list-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.finance-report {
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.finance-report__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid rgba(70, 42, 35, 0.1);
}

.finance-report__lead {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.finance-report__meta {
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.finance-print {
  min-height: 44px;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.finance-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 1rem;
  border: 1px solid rgba(70, 42, 35, 0.1);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f8fafb);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.finance-summary-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(143, 31, 29, 0.07);
}

.finance-summary-card__label {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.finance-summary-card strong {
  display: block;
  margin-top: 0.55rem;
  font-family: Poppins, sans-serif;
  font-size: clamp(1.35rem, 3.8vw, 1.8rem);
  line-height: 1.1;
}

.finance-summary-card--saldo {
  border-color: transparent;
  color: #fffaf0;
}

.finance-summary-card--saldo .finance-summary-card__label,
.finance-summary-card--saldo strong {
  color: inherit;
}

.finance-summary-card--saldo.is-positive {
  background: linear-gradient(135deg, #17866a, #11624e);
}

.finance-summary-card--saldo.is-negative {
  background: linear-gradient(135deg, #9e2621, #7b1d19);
}

.finance-identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  padding: 0;
  border-bottom: 0;
}

.finance-identity > div {
  padding: 0.95rem;
  border: 1px solid rgba(70, 42, 35, 0.1);
  border-radius: 20px;
  background: #f7f9fa;
}

.finance-identity__label {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.finance-identity strong {
  display: block;
  margin-top: 0.2rem;
  font-family: Poppins, sans-serif;
  font-size: 1rem;
}

.finance-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(70, 42, 35, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.finance-table__head,
.finance-table__row {
  display: grid;
  gap: 0.75rem;
}

.finance-table__head {
  grid-template-columns: 90px minmax(0, 1.7fr) minmax(88px, 0.8fr) minmax(88px, 0.8fr);
  padding: 0.78rem 1rem;
  color: rgba(50, 21, 21, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #f3f5f6;
  border-bottom: 1px solid rgba(70, 42, 35, 0.1);
}

.finance-table__row {
  grid-template-columns: 90px minmax(0, 1.7fr) minmax(88px, 0.8fr) minmax(88px, 0.8fr);
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(70, 42, 35, 0.08);
  background: transparent;
  font-size: 0.94rem;
  line-height: 1.3;
}

.finance-table--ledger .finance-table__head,
.finance-table--ledger .finance-table__row {
  grid-template-columns: 90px minmax(0, 1.55fr) minmax(82px, 0.7fr) minmax(82px, 0.7fr);
}

.finance-table--ledger.finance-table--editable .finance-table__head,
.finance-table--ledger.finance-table--editable .finance-table__row {
  grid-template-columns: 90px minmax(0, 1.45fr) minmax(82px, 0.65fr) minmax(82px, 0.65fr) 82px;
}

.finance-table--ledger {
  border: 1px solid rgba(70, 42, 35, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}

.finance-table--ledger .finance-table__head {
  padding: 0.78rem 1rem;
  background: #f3f5f6;
  border-bottom: 1px solid rgba(70, 42, 35, 0.1);
  color: rgba(50, 21, 21, 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.finance-table--ledger .finance-table__row {
  padding: 0.9rem 1rem;
  background: transparent;
  border-bottom: 1px solid rgba(70, 42, 35, 0.08);
  font-size: 0.95rem;
}

.finance-table__row:last-child {
  border-bottom: 0;
}

.finance-table__row span {
  min-width: 0;
}

.finance-entry {
  display: grid;
  gap: 0.12rem;
}

.finance-entry--inline {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.finance-entry strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.finance-entry__event {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.finance-entry small {
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

.is-right {
  text-align: right;
}

.finance-amount,
.finance-balance {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.finance-table--ledger .finance-amount.negative {
  color: #c0392b;
}

.finance-actions {
  display: flex;
  justify-content: flex-end;
}

.finance-edit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(143, 31, 29, 0.12);
  border-radius: 12px;
  background: rgba(143, 31, 29, 0.07);
  color: var(--primary);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  text-decoration: none;
}

.finance-edit-badge:hover,
.finance-edit-badge:focus {
  border-color: rgba(143, 31, 29, 0.25);
  background: rgba(143, 31, 29, 0.06);
  color: rgba(143, 31, 29, 0.78);
}

@media (min-width: 720px) {
  .card-hero {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
  }

  .finance-grid-sys {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .finance-grid-sys > .card:nth-child(2) {
    grid-row: span 2;
  }

  .onboarding-card {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

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

  .form-grid label:last-of-type,
  .form-grid .full,
  .form-grid button {
    grid-column: 1 / -1;
  }

  .form-grid .mode-switch label,
  .form-grid .mode-switch label:last-of-type {
    grid-column: auto;
  }

  .event-manager__form {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  }

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

}

@media (min-width: 980px) {
  .sys-shell {
    padding-top: 1.25rem;
  }

  .sys-header {
    position: sticky;
    top: 1rem;
    z-index: 10;
  }

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

  .finance-report {
    padding: 1.4rem;
  }
}

@media (max-width: 719px) {
  .sys-shell {
    width: min(100%, 430px);
    padding: 0;
  }

  .sys-header {
    margin: 0;
    border-radius: 0 0 30px 30px;
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem 1.15rem;
  }

  .sys-brand img {
    width: 78px;
    height: 50px;
  }

  .sys-brand-copy strong {
    font-size: 0.98rem;
  }

  .sys-greeting-wrap {
    width: 100%;
  }

  .sys-greeting {
    width: 100%;
    border-radius: 18px;
  }

  .sys-nav {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .sys-nav::-webkit-scrollbar {
    display: none;
  }

  .sys-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .sys-main {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .finance-grid-sys {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .finance-table__head {
    display: none;
  }

  .finance-table {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .finance-table__row,
  .finance-table--ledger .finance-table__row,
  .finance-table--statement .finance-table__row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(70, 42, 35, 0.08);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .finance-table__row > span:not(.finance-entry) {
    display: grid;
    grid-template-columns: minmax(110px, 40%) minmax(0, 1fr);
    align-items: start;
    gap: 0.9rem;
  }

  .finance-table__row > span:not(.finance-entry)::before {
    content: attr(data-label);
    display: block;
    justify-self: start;
    text-align: left;
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .finance-table__row > span:not(.finance-entry):not(.is-right) {
    text-align: right;
  }

  .finance-entry {
    display: grid;
    grid-template-columns: minmax(96px, 42%) minmax(0, 1fr);
    gap: 0.3rem;
    column-gap: 1rem;
    align-items: start;
  }

  .finance-entry::before {
    content: attr(data-label);
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .finance-entry strong,
  .finance-entry small,
  .finance-entry__event {
    grid-column: 2;
    min-width: 0;
    text-align: right;
  }

  .finance-entry strong {
    font-size: 0.92rem;
  }

  .finance-entry small,
  .finance-entry__event {
    font-size: 0.75rem;
  }

  .finance-table__row .is-right {
    text-align: right;
  }

  .finance-table--ledger .finance-table__row {
    padding: 0.95rem 1rem;
  }

  .finance-table--ledger .finance-balance,
  .finance-table--statement .finance-balance {
    font-size: 0.92rem;
  }

  .finance-table--ledger.finance-table--editable .finance-table__row {
    grid-template-columns: 1fr;
  }

  .finance-table--ledger .finance-actions {
    display: flex;
    justify-content: flex-end;
  }

  .finance-table--ledger .finance-actions::before {
    content: none;
  }

  .event-manager__item,
  .event-manager__form {
    grid-template-columns: 1fr;
  }

  .event-manager summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .event-manager > summary > .event-manager__action {
    justify-self: start;
  }

  .event-manager__delete,
  .event-manager__form .button,
  .event-manager__delete .button {
    width: 100%;
  }

  .mode-switch label {
    width: 100%;
    min-width: 0;
  }

  .lancamento-multiplo__head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lancamento-repeat {
    justify-content: center;
    width: 100%;
  }

  .lancamento-checklist {
    max-height: 440px;
    border-radius: 18px;
  }

  .lancamento-checklist table,
  .lancamento-checklist thead,
  .lancamento-checklist tbody,
  .lancamento-checklist tr,
  .lancamento-checklist th,
  .lancamento-checklist td {
    display: block;
    width: 100%;
  }

  .lancamento-checklist thead {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .lancamento-checklist thead tr {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    background: #f3f5f6;
    border-bottom: 1px solid rgba(70, 42, 35, 0.1);
  }

  .lancamento-checklist thead th:nth-child(3) {
    display: none;
  }

  .lancamento-checklist tbody tr {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.45rem 0.65rem;
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid rgba(70, 42, 35, 0.1);
  }

  .lancamento-checklist th,
  .lancamento-checklist td,
  .lancamento-checklist th:nth-child(1),
  .lancamento-checklist td:nth-child(1),
  .lancamento-checklist th:nth-child(2),
  .lancamento-checklist td:nth-child(2),
  .lancamento-checklist th:nth-child(3),
  .lancamento-checklist td:nth-child(3) {
    width: auto;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
  }

  .lancamento-checklist tbody td:nth-child(3) {
    grid-column: 2;
  }

  .lancamento-checklist input[type="text"] {
    width: 100%;
  }

  .finance-table__row:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(70, 42, 35, 0.08);
  }
}

@media (max-width: 719px) {
  .card-hero,
  .finance-grid-sys > .card,
  .finance-report {
    padding: 1rem;
  }

  .card-hero,
  .finance-report__head,
  .finance-list-heading {
    align-items: stretch;
  }

  .toolbar-actions,
  .filters {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
  }

  .toolbar-actions > *,
  .filters > *,
  .finance-report__meta .button,
  .finance-report__meta .finance-print,
  .form-grid button {
    width: 100%;
  }

  .athlete-manager {
    gap: 1.25rem;
  }

  .athlete-manager__delete {
    margin-top: 0;
  }

  .finance-grid-sys {
    gap: 0.85rem;
  }

  .sys-nav a.sys-nav-logout {
    margin-left: 0;
  }

  .finance-summary-grid,
  .finance-identity {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .finance-summary-card {
    min-height: 96px;
    padding: 0.85rem;
  }

  .finance-summary-card strong {
    font-size: 1.28rem;
  }

  .finance-identity {
    padding: 0;
  }

  .finance-report__meta {
    justify-items: start;
    gap: 0.65rem;
  }

  .finance-list-heading > div:empty {
    display: none;
  }

  .filters label,
  .filters select,
  .filters input {
    width: 100%;
  }

  .form-grid input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .card-hero,
  .finance-grid-sys > .card,
  .finance-report {
    padding: 0.9rem 0.85rem;
  }

  .card-heading h1,
  .finance-report h2,
  .empty-state h2 {
    font-size: 1.55rem;
  }

  .finance-report__lead,
  .card-heading p {
    line-height: 1.45;
  }

  .finance-summary-card strong {
    font-size: 1.18rem;
  }

  .finance-table__row span::before {
    flex-basis: 40%;
    font-size: 0.74rem;
  }
}

@media screen {
  :root {
    --radius: 28px;
    --radius-sm: 20px;
    --app-width: 430px;
    --bottom-nav-height: 86px;
  }

  body {
    min-height: 100vh;
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
  }

  .sys-shell {
    position: relative;
    width: min(100%, var(--app-width));
    min-height: 100vh;
    margin: 0 auto;
    padding: 0;
    overflow: clip;
    background: #eef1f4;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02), 0 28px 80px rgba(30, 20, 18, 0.16);
  }

  .sys-header {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 20;
    display: grid;
    width: min(100%, var(--app-width));
    min-height: 214px;
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 78px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateX(-50%);
  }

  .sys-header__top,
  .sys-header-actions,
  .sys-icon-button,
  .sys-avatar-button {
    display: flex;
    align-items: center;
  }

  .sys-header__top {
    justify-content: space-between;
    gap: 16px;
  }

  .sys-brand {
    gap: 0.8rem;
  }

  .sys-brand img {
    width: 92px;
    height: 58px;
  }

  .sys-brand-copy strong {
    font-size: 1rem;
    line-height: 1.05;
  }

  .sys-brand-copy span {
    font-size: 0.8rem;
  }

  .sys-header-actions {
    gap: 10px;
  }

  .sys-icon-button,
  .sys-avatar-button {
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff8ea;
    box-shadow: 0 10px 24px rgba(40, 0, 0, 0.18);
    backdrop-filter: blur(14px);
  }

  .sys-avatar-button {
    background: #fff8ea;
    color: var(--primary);
  }

  .sys-greeting-wrap {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    margin-top: 24px;
    justify-items: start;
  }

  .sys-greeting {
    width: auto;
    max-width: 310px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff8ea;
    font-family: Poppins, sans-serif;
    font-size: 1.46rem;
    font-weight: 800;
    line-height: 1.08;
  }

  .sys-greeting-link {
    padding: 0;
    color: rgba(255, 248, 234, 0.78);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
  }

  .sys-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-auto-columns: 72px;
    grid-auto-flow: column;
    width: min(100%, var(--app-width));
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    overflow-x: auto;
    border-top: 1px solid rgba(70, 42, 35, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -18px 42px rgba(30, 20, 18, 0.12);
    transform: translateX(-50%);
    scrollbar-width: none;
  }

  .sys-nav::-webkit-scrollbar {
    display: none;
  }

  .sys-nav a,
  .sys-nav a.sys-nav-logout {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0.45rem 0.35rem;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    backdrop-filter: none;
  }

  .sys-nav a i {
    color: var(--primary);
    font-size: 1.22rem;
    line-height: 1;
  }

  .sys-nav a:hover,
  .sys-nav a:focus-visible,
  .sys-nav a.sys-nav-logout:hover,
  .sys-nav a.sys-nav-logout:focus-visible {
    background: rgba(143, 31, 29, 0.08);
    color: var(--primary);
  }

  .sys-main {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    padding: 196px 16px calc(var(--bottom-nav-height) + 26px);
  }

  .card,
  .sumula-card,
  .finance-report {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .card {
    padding: 1.15rem;
  }

  .card-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: 0;
    padding: 1.2rem;
  }

  .card-heading h1 {
    font-size: 1.5rem;
    line-height: 1.12;
  }

  .card-heading h2 {
    margin: 0;
    font-family: Poppins, sans-serif;
    font-size: 1.1rem;
    line-height: 1.18;
  }

  .card-heading p {
    line-height: 1.5;
  }

  .eyebrow {
    color: var(--text-soft);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .toolbar,
  .toolbar-actions,
  .filters {
    display: grid;
    gap: 0.75rem;
    align-items: stretch;
  }

  .toolbar-actions > *,
  .filters > *,
  .form-grid button,
  .sumula-actions .button {
    width: 100%;
  }

  .button {
    min-height: 50px;
    border-radius: 18px;
  }

  .button-secondary,
  .status-chip {
    background: rgba(143, 31, 29, 0.08);
    color: var(--primary);
  }

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

  .form-grid label,
  .form-grid label:last-of-type,
  .form-grid .full,
  .form-grid button {
    grid-column: auto;
  }

  .form-grid input,
  .form-grid select,
  .filters input,
  .filters select {
    min-height: 50px;
    border-radius: 16px;
    background: #fbfaf7;
  }

  .finance-grid-sys {
    grid-template-columns: 1fr;
  }

  .finance-grid-sys > .card:nth-child(2) {
    grid-row: auto;
  }

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

  .onboarding-copy {
    padding: 1rem;
    border: 1px solid rgba(70, 42, 35, 0.08);
    border-radius: 22px;
    background: #f7f9fa;
  }

  .onboarding-brand img {
    width: min(100%, 240px);
  }

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

  .period-heading {
    padding-inline: 0.2rem;
  }

  .period-heading h2 {
    font-size: 1rem;
  }

  .sumula-card {
    overflow: hidden;
  }

  .sumula-body,
  .sumula-actions {
    padding: 1rem;
  }

  .finance-report {
    padding: 1rem;
  }

  .finance-report__head,
  .finance-list-heading {
    display: grid;
    align-items: stretch;
  }

  .finance-report__meta {
    justify-items: start;
  }

  .finance-summary-grid,
  .finance-identity {
    grid-template-columns: 1fr;
  }

  .finance-table__head {
    display: none;
  }

  .finance-table {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .finance-table__row,
  .finance-table--ledger .finance-table__row,
  .finance-table--statement .finance-table__row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(70, 42, 35, 0.08);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .finance-table__row:last-child {
    margin-bottom: 0;
  }
}

@media print {
  .sys-header,
  .finance-grid-sys,
  .toolbar-actions,
  .finance-print {
    display: none !important;
  }

  .sys-shell {
    width: 100%;
    padding: 0;
  }

  .card,
  .finance-summary-card {
    box-shadow: none;
  }
}
