:root {
  --ink: #1c2430;
  --muted: #3e4c5f;
  --line: #e4e7ee;
  --sidebar: #f3f4f7;
  --canvas: #eef0f4;
  --orange: #c2410c;
  --festa: #b72974;
  --blue: #1d4ed8;
  --surface: #fff;
  --side: 248px;
  --top: 64px;
  --z-sidebar: 30;
  --z-backdrop: 25;
  --z-top: 20;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

svg { display: block; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .22s var(--ease), width .22s var(--ease);
}

.side-logo {
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.brand-mark svg { width: 16px; height: 16px; display: block; fill: currentColor; }

.side-user { padding: 4px 12px 8px; }

.user-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}

.user-card { color: inherit; text-decoration: none; }
.user-card:hover { border-color: #b7c0ce; }
.user-card[aria-current="page"] { border-color: #2563eb; }
.account-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.account-card {
  max-width: 920px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.account-block { padding: 22px 24px 6px; }
.account-block + .account-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 20px; }
.account-block h2 { margin: 0 0 4px; font-size: 15px; font-weight: 700; text-wrap: balance; }
.account-lead { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.account-logo { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.account-logo img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  flex: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.account-logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d5dbe5;
  background: #fff;
  color: #243041;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.account-btn svg { width: 16px; height: 16px; }
.account-btn-blue { border-color: #93c5fd; color: #1d4ed8; }
.account-btn-blue:hover { background: #eff6ff; }
.account-btn:hover { background: #f8fafc; }
.account-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.account-note svg { width: 15px; height: 15px; flex: none; }
.file-pick-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 0 0 18px;
}
.account-span { grid-column: 1 / -1; }
.account-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: #243041; }
.account-control { position: relative; }
.account-control svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: #5c6b7e;
  transform: translateY(-50%);
  pointer-events: none;
}
.account-control input {
  width: 100%;
  height: 42px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  padding: 0 12px 0 38px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}
.account-control input::placeholder { color: #5c6b7e; }
.account-control input:focus { outline: 2px solid #bfdbfe; border-color: #3b82f6; }
.account-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
  padding: 16px 24px;
  background: #f7f8fa;
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
}
.account-save {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #1c2430;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.account-save:hover { background: #111827; }
.account-exit {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}
.account-exit:hover { color: #1e3a8a; }
@media (max-width: 720px) {
  .account-grid { grid-template-columns: 1fr; }
  .account-span { grid-column: auto; }
  .account-logo { align-items: flex-start; }
  .account-block, .account-footer { padding-left: 16px; padding-right: 16px; }
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dbe4f3;
  color: #1e3a5f;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-copy strong { font-size: 13.5px; font-weight: 700; }
.user-copy small { color: var(--muted); font-size: 12px; }

.side-nav {
  padding: 8px 10px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav > a,
.side-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.side-nav > a svg,
.side-group summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  flex: none;
}

.side-nav > a:hover,
.side-group summary:hover { background: rgba(255, 255, 255, .7); }

.side-nav > a.is-on,
.side-group summary.is-on {
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.side-group summary { list-style: none; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group .chev { margin-left: auto; width: 16px; height: 16px; }
.side-group[open] .chev { transform: rotate(180deg); }
.side-group > a { display: none; }
.side-group[open] > a {
  display: block;
  margin-left: 28px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.side-group a:hover,
.side-group > a.is-on { background: var(--surface); color: var(--ink); }

.side-nav { flex: 1; min-height: 0; }
.side-nav > a span,
.side-group summary > span,
.side-logo > span:not(.brand-mark) { white-space: nowrap; }
.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 16px;
}
.side-foot button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #c5ceda;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
.side-foot button:hover { background: rgba(255, 255, 255, .7); }
.side-foot button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.side-foot svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.side-foot [data-tema],
.side-foot [data-recolher] { width: 42px; height: 42px; }
html:not([data-tema="dark"]) .icone-sol,
html[data-tema="dark"] .icone-lua { display: none; }
@media (min-width: 992px) {
  html[data-menu="fechado"] { --side: 76px; }
  html[data-menu="fechado"] .side-logo { justify-content: center; padding: 0; }
  html[data-menu="fechado"] .side-logo > span:not(.brand-mark),
  html[data-menu="fechado"] .user-copy,
  html[data-menu="fechado"] .side-nav span,
  html[data-menu="fechado"] .side-group .chev,
  html[data-menu="fechado"] .side-group > a,
  html[data-menu="fechado"] .side-foot span { display: none; }
  html[data-menu="fechado"] .side-user { padding: 4px 10px 8px; }
  html[data-menu="fechado"] .user-card { justify-content: center; padding: 8px; }
  html[data-menu="fechado"] .side-nav > a,
  html[data-menu="fechado"] .side-group summary { justify-content: center; padding: 0; }
  html[data-menu="fechado"] .side-foot {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
  }
  html[data-menu="fechado"] .side-foot [data-tema],
  html[data-menu="fechado"] .side-foot [data-recolher] { width: 42px; height: 42px; }
  html[data-menu="fechado"] .side-chev { transform: scaleX(-1); }
}
@media (max-width: 991px) {
  .side-foot [data-recolher] { display: none; }
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .38);
  z-index: var(--z-backdrop);
}

.shell { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .22s var(--ease); }

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-top);
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 18px;
  background: var(--canvas);
}

.search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 46%);
}

.search svg {
  position: absolute;
  left: 14px;
  top: 11px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}

.search input {
  width: 100%;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  padding: 0 16px 0 38px;
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}

.search input::placeholder { color: #4b5568; }
.search input:focus {
  outline: none;
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.plus {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.plus::after { display: none; }
.plus svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.plus:hover { background: #1e40af; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  display: none;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.canvas { padding: 6px 22px 32px; }
.canvas.is-fill { padding: 0 14px 14px; display: flex; flex-direction: column; min-height: calc(100vh - var(--top)); }
.canvas h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.canvas h2 { font-size: 1rem; font-weight: 700; }
.canvas .text-secondary { color: var(--muted) !important; }

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
}
.summary div { padding: 14px 16px; }
.summary div + div { box-shadow: inset 1px 0 0 var(--line); }
.summary span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.summary strong { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.table-responsive {
  background: #fff;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: 11px 14px; vertical-align: middle; }
.table thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #fafbfc;
  border-bottom-color: var(--line);
  white-space: nowrap;
}
.table td { border-color: #eef0f4; }
.table a { color: #1e3a8a; font-weight: 700; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose { white-space: pre-wrap; }

.btn { border-radius: 8px; font-weight: 700; font-size: 13px; }
.btn-dark { background: #1f2937; border-color: #1f2937; }
.btn-dark:hover { background: #111827; border-color: #111827; }
.btn-outline-dark { background: #fff; border-color: #d5dbe5; color: var(--ink); }
.btn-outline-dark:hover { background: #f3f4f6; color: var(--ink); border-color: #c5ccd6; }
.form-label { font-size: 13px; font-weight: 700; color: #243041; }
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d5dbe5;
  min-height: 40px;
  color: var(--ink);
}
.form-control::placeholder { color: #4b5568; }
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
.nav-tabs { border: 0; gap: 4px; }
.nav-tabs .nav-link {
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 12px;
}
.nav-tabs .nav-link.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.badge { font-weight: 700; }
.alert { border-radius: 10px; }
.alert-success { background: #ecfdf3; color: #14532d; border-color: #bbf7d0; }
.alert-toast { transition: opacity .28s cubic-bezier(.16, 1, .3, 1), transform .28s cubic-bezier(.16, 1, .3, 1); }
.alert-toast.is-out { opacity: 0; transform: translateY(-8px); }
.page-link { color: var(--ink); border-radius: 8px; margin-right: 6px; }
.page-item.active .page-link, .page-link:hover { background: #fff; color: var(--ink); }
.progress { height: 8px; background: #e7ebf2; }
.progress-bar { background: #334155; }

.cal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px 8px;
}

.cal-bar h1 {
  margin: 0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cal-nav, .cal-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-tools { justify-content: flex-end; }

.cal-arrows { display: inline-flex; background: #1f2937; border-radius: 8px; overflow: hidden; }
.cal-arrows a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
}
.cal-arrows a + a { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .18); }
.cal-arrows svg { width: 16px; height: 16px; }

.cal-btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.cal-btn:hover { background: #111827; color: #fff; }

.cal-switch {
  display: inline-flex;
  padding: 3px;
  background: #f3f4f6;
  border-radius: 9px;
  gap: 2px;
}
.cal-switch a {
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.cal-switch a.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }

.cal-filter { position: relative; }
.cal-filter summary { list-style: none; }
.cal-filter summary::-webkit-details-marker { display: none; }
.cal-filter summary {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.cal-filter form { display: none; }
.cal-filter[open] form {
  display: flex;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .12);
  padding: 12px;
  flex-direction: column;
  gap: 8px;
}
.cal-filter label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cal-filter .cal-btn { justify-content: center; }

.cal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.cal-grid.is-mes { grid-template-rows: 34px repeat(var(--semanas), minmax(96px, auto)); }
.cal-grid.is-semana { grid-template-rows: 34px minmax(420px, 1fr); }

.cal-dow {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.cal-cell {
  min-width: 0;
  padding: 6px 6px 8px;
  border-top: 1px solid #eef0f4;
  border-left: 1px solid #eef0f4;
  background: #fff;
}
.cal-grid .cal-dow:nth-child(7n + 1),
.cal-cell:nth-child(7n + 1) { border-left: 0; }
.cal-cell.is-out { background: #fafbfc; }
.cal-cell.is-out .cal-num { color: #9aa3b2; }

.cal-num {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin: 0 0 4px 2px;
  color: #526072;
  font-size: 12.5px;
  font-weight: 700;
}
.cal-cell.is-today .cal-num {
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  min-width: 24px;
}

.chip {
  display: block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip:hover { color: #fff; filter: brightness(1.08); }
.chip-fatura { background: var(--orange); }
.chip-festa { background: var(--festa); }
.chip-evento { background: #334155; }
button.chip {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
button.chip svg { width: 12px; height: 12px; flex: none; }
button.chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lembrete-sheet { position: relative; padding: 22px 20px 18px; }
.lembrete-kicker { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lembrete-dialog h2 { margin: 0 0 6px; font-size: 1.25rem; }
.lembrete-dialog [data-lembrete-data] { margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.lembrete-dialog [data-lembrete-texto] { margin: 0 0 16px; white-space: pre-wrap; }
.lembrete-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #526072;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lembrete-x:hover { background: #f3f4f6; }
.lembrete-form .festa-optional { display: block; margin-top: 6px; }
.lembrete-vezes { margin-left: 4px; color: var(--muted); font-weight: 700; }
.lembrete-infinito { margin-left: 4px; font-weight: 700; letter-spacing: 0; }
.chip.is-off { opacity: .55; text-decoration: line-through; }
.cal-more { display: inline-block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }

.cal-dayboard { padding: 8px 18px 24px; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.cal-dayboard .chip { font-size: 13px; padding: 8px 12px; }
.cal-empty { color: var(--muted); margin: 12px 0; }
.cal-agenda { display: none; padding: 8px 16px 20px; }
.cal-agenda h2 { font-size: .95rem; margin: 14px 0 6px; }
.cal-agenda ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.home-board { display: grid; gap: 14px; margin: 14px 0 8px; }
.home-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  padding: 14px 16px 16px;
  min-width: 0;
}
.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.home-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.home-card h2 svg { width: 16px; height: 16px; color: #667085; flex: none; }
.home-card-links, .home-card-head > a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.home-card-links span { color: var(--muted); font-weight: 600; }
.home-card-links span::before { content: ""; display: inline-block; width: 1px; height: 12px; margin-right: 12px; background: #d5dbe5; vertical-align: -1px; }
.home-card a:hover { text-decoration: underline; }
.home-empty { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.pay-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pay-stat {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: inherit;
  text-decoration: none;
}
a.pay-stat:hover { border-color: #c7d7fb; background: #f4f7fb; text-decoration: none; }
.pay-stat span, .pay-stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pay-stat strong { display: block; margin: 2px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.pay-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 10px; color: var(--muted); font-size: 12.5px; }
.pay-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pay-legend i { width: 22px; height: 12px; border-radius: 2px; }
.pay-legend i.is-now, .pay-bar.is-now { background: rgba(37, 155, 35, .22); border: 1px solid #84c529; }
.pay-legend i.is-prev, .pay-bar.is-prev { background: rgba(197, 61, 169, .55); border: 1px solid #c53da9; }
.pay-scroll { overflow-x: auto; }
.pay-chart {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: 220px auto;
  column-gap: 8px;
  min-width: 640px;
}
.pay-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pay-plot {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  height: 220px;
  border-bottom: 1px solid #e7ebf2;
  background-image: repeating-linear-gradient(to top, #e7ebf2 0 1px, transparent 1px calc(100% / var(--faixas)));
}
.pay-col { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; min-width: 0; border-radius: 8px; }
.pay-col.is-today { background: #f4f7fb; }
.pay-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 36px;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}
a.pay-pair:hover { text-decoration: none; }
a.pay-pair:hover .pay-bar { filter: brightness(.92); }
.pay-value { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.pay-bar { width: 14px; max-height: calc(100% - 16px); border-radius: 3px 3px 0 0; }
.pay-pair.is-future { color: #98a2b3; }
.pay-days { grid-column: 2; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 8px; }
.pay-days > span { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--muted); font-size: 12px; }
.pay-days > span.is-today { color: var(--ink); font-weight: 700; }
.pay-days small { color: #1d4ed8; font-size: 10px; font-weight: 700; }
.pay-short { display: none; }
.home-scroll { max-height: 320px; overflow: auto; }
.home-expire { width: 100%; border-collapse: collapse; }
.home-expire th, .home-expire td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eef0f4; font-size: 13px; }
.home-expire th { position: sticky; top: 0; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; }
.home-expire td:nth-child(n + 3), .home-expire th:nth-child(n + 3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-expire a { color: var(--ink); font-weight: 700; text-decoration: none; }
.home-expire a:hover { color: #1d4ed8; }
.festa-return {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 10px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.festa-return svg { width: 16px; height: 16px; }
.festa-return:hover { text-decoration: underline; }
.festa-head { margin-bottom: 14px; }
.festa-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.festa-card {
  max-width: 760px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.festa-block { padding: 20px 22px 6px; }
.festa-block + .festa-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 18px; }
.festa-block h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 15px;
}
.festa-block h2 svg { width: 16px; height: 16px; color: #5c6b7e; }
.festa-block > p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.festa-combo {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #fff;
}
.festa-combo svg { width: 16px; height: 16px; margin-left: 12px; color: #5c6b7e; }
.festa-combo input, .festa-combo select {
  width: 100%;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.festa-combo input { padding: 0 12px 0 0; }
.festa-combo input:focus, .festa-combo select:focus { outline: none; }
.festa-combo:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.client-picker { position: relative; }
.client-picker .client-source {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  pointer-events: none;
  white-space: nowrap;
  border: 0;
}
.client-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.client-list li {
  padding: 8px 10px;
  border-radius: 8px;
  color: #243041;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.client-list li.is-active { background: #eff6ff; color: #1e3a8a; }
.client-list .client-empty { color: #5c6b7e; font-weight: 500; cursor: default; }
.festa-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
.festa-2 { grid-column: span 3; }
.festa-3 { grid-column: span 2; }
.festa-span { grid-column: 1 / -1; }
.grupo-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.grupo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d9dee7;
  border-radius: 999px;
  background: #fff;
  color: #243041;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.grupo-chip input { width: 15px; height: 15px; margin: 0; }
.grupo-chip:has(input:checked) { border-color: #93c5fd; background: #eff6ff; color: #1e3a8a; }
.festa-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: #243041; }
.festa-label { display: flex; align-items: baseline; gap: 4px; }
.festa-field abbr { color: #b42318; text-decoration: none; }
.festa-optional { color: var(--muted); font-weight: 600; }
.festa-field input, .festa-field select, .festa-field textarea {
  width: 100%;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}
.festa-field input, .festa-field select { height: 42px; padding: 0 12px; }
.festa-field textarea { min-height: 118px; padding: 10px 12px; resize: vertical; margin-bottom: 16px; }
.nota-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nota-excluir {
  flex: none;
  border: 1px solid #f3c1bc;
  background: #fff;
  color: #b42318;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}
.nota-excluir:hover { background: #fef3f2; }
.festa-field input::placeholder, .festa-field textarea::placeholder { color: #5c6b7e; }
.festa-field input:focus, .festa-field select:focus, .festa-field textarea:focus {
  outline: 2px solid #bfdbfe;
  border-color: #3b82f6;
}
.festa-money { display: flex; align-items: center; border: 1px solid #d9dee7; border-radius: 10px; background: #fff; }
.festa-money > span { padding-left: 12px; color: #5c6b7e; font-weight: 600; }
.festa-money input { border: 0; border-radius: 10px; }
.festa-money:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.festa-money input:focus { outline: none; }
.festa-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  font-weight: 400;
}
.festa-check input { width: 16px; height: 16px; margin-top: 2px; }
.festa-check strong, .festa-check small { display: block; }
.festa-check strong { font-size: 14px; }
.festa-check small { color: var(--muted); font-size: 12.5px; }
.festa-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: #f7f8fa;
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
}
.festa-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #1c2430;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.festa-save svg { width: 16px; height: 16px; }
.festa-save:hover { background: #111827; }
.festa-back {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid #d5dbe5;
  border-radius: 10px;
  background: #fff;
  color: #243041;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.festa-back:hover { background: #f8fafc; }
@media (max-width: 720px) {
  .festa-grid { grid-template-columns: 1fr; }
  .festa-2, .festa-3, .festa-span { grid-column: auto; }
  .festa-combo { grid-template-columns: 36px minmax(0, 1fr); }
  .festa-block, .festa-footer { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 720px) {
  .home-card-head { align-items: flex-start; flex-direction: column; }
  .pay-stats { grid-template-columns: 1fr; }
  .pay-long { display: none; }
  .pay-short { display: inline; }
  .pay-chart { min-width: 0; }
  .home-expire thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .home-expire, .home-expire tbody, .home-expire tr, .home-expire td { display: block; width: auto; }
  .home-expire tr { padding: 10px 0; border-bottom: 1px solid #eef0f4; }
  .home-expire td { border: 0; padding: 2px 0; text-align: left !important; }
  .home-expire td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
}

body.is-wide .sidebar { transform: translateX(-105%); }
body.is-wide .shell { margin-left: 0; }

@media (max-width: 1100px) {
  .search { position: static; transform: none; width: auto; flex: 1; }
  .cal-bar { grid-template-columns: 1fr; }
  .cal-bar h1 { order: -1; }
  .cal-tools { justify-content: flex-start; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary div:nth-child(odd) { box-shadow: none; }
  .summary div:nth-child(n + 3) { box-shadow: inset 0 1px 0 var(--line); }
}

@media (max-width: 991px) {
  .menu-toggle { display: grid; }
  .sidebar { transform: translateX(-105%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .backdrop { display: block; }
  .shell { margin-left: 0; }
  .cal-grid { display: none; }
  .cal-agenda { display: block; }
  .cal { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .shell { transition: none; }
  .chip:hover { filter: none; }
  .alert-toast { transition: none; }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}
.login-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, .06);
}
.login-card h1 { font-size: 1.6rem; letter-spacing: -0.03em; font-weight: 700; margin: 8px 0 4px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }

.invoice-split {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.invoice-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}
.invoice-list-head { padding: 14px 14px 8px; }
.invoice-list-head h2 { margin: 0; font-size: 1rem; }
.invoice-list-head a { color: var(--muted); text-decoration: none; font-size: 13px; }
.invoice-rows { overflow: auto; }
.invoice-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #eef0f4;
  text-decoration: none;
  color: var(--ink);
}
.invoice-row strong, .invoice-row b { display: block; font-weight: 700; }
.invoice-row small, .invoice-row em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.invoice-row.is-current { background: #f3f6fb; }
.st-parcial, .st-vencida { color: #c2410c; }
.st-paga { color: #157a32; }
.st-aberta { color: #b42318; }
.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px 20px;
}
.preview-logo { width: 148px; height: auto; margin: 4px 0 18px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.preview-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-tools .btn { background: #fff; border: 1px solid #d5dbe5; color: #334155; font-weight: 700; }
.sheet-code { margin: 0 0 10px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.sheet-kicker { font-weight: 700; }
.sheet-meta { margin-top: 14px; }
.sheet-totals .is-due { color: #d12b2b; }
.pay-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #2f9e44;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.pay-btn:hover { background: #26873a; color: #fff; }
.sheet-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0 18px; }
.sheet-bill { text-align: right; }
.sheet-client { font-weight: 700; margin-bottom: 14px; }
.sheet-table thead th { background: #eceff3; }
.sheet-totals { width: min(100%, 340px); margin: 14px 0 18px auto; }
.sheet-totals div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 10px; font-weight: 700; }
.sheet-totals .is-bar { background: #eceff3; }
.sheet h2 { font-size: 1rem; margin: 8px 0 10px; }
.sheet-sign { margin-top: 28px; }
.sheet-sign span { display: inline-block; width: min(240px, 46%); border-bottom: 1px solid #333; transform: translateY(-3px); }
.pay-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  overflow: hidden;
}
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 0; }
.pay-head h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; }
.pay-head h3 svg { width: 16px; height: 16px; color: #5c6b7e; }
.pay-head p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 13.5px; }
.pay-due { flex: none; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fa; text-align: right; }
.pay-due span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.pay-due strong { color: var(--ink); font-size: 16px; letter-spacing: -0.02em; }
.pay-modes, .pay-empty { margin: 14px 22px 0; color: var(--muted); font-size: 13.5px; }
.pay-empty { margin-bottom: 18px; }
.pay-empty a { color: #1d4ed8; font-weight: 700; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; padding: 16px 22px 8px; }
.pay-span { grid-column: 1 / -1; }
.pay-foot { display: flex; padding: 16px 22px; background: #f7f8fa; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .pay-head, .pay-foot { padding-left: 16px; padding-right: 16px; }
  .pay-head { flex-direction: column; }
  .pay-due { text-align: left; }
  .pay-grid { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .pay-modes, .pay-empty { margin-left: 16px; margin-right: 16px; }
}
.pdf-link { margin-left: 8px; font-size: 12px; font-weight: 700; }
@media (max-width: 991px) {
  .invoice-split { grid-template-columns: 1fr; }
  .invoice-list { position: static; max-height: 280px; }
  .sheet { padding: 18px 14px; }
  .sheet-parties { grid-template-columns: 1fr; }
  .sheet-bill { text-align: left; }
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.page-head h1 { margin: 0; }
.crumb { margin: 0 0 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 14px;
  overflow: hidden;
}
.stat-row a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: inset 1px 0 0 var(--line);
}
.stat-row a:first-child { box-shadow: none; }
.stat-row a:hover { background: #f8fafc; }
.stat-row a.is-on { background: #f3f6fb; }
.stat-row strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-row span { font-size: 13px; font-weight: 600; }
.stat-row .tom-verde { color: #157a32; }
.stat-row .tom-vermelho { color: #b42318; }
.stat-row .tom-laranja { color: #9a3412; }

.data-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.data-card > .table-responsive {
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.data-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.data-tools + .table-responsive,
.data-filters + .table-responsive,
form + .table-responsive { border-top: 1px solid var(--line); }
.page-size select {
  height: 36px;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  font-weight: 600;
  color: var(--ink);
}
.data-search { margin-left: auto; position: relative; width: min(260px, 100%); }
.data-search svg {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}
.data-search input {
  width: 100%;
  height: 36px;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  padding: 0 12px 0 32px;
  color: var(--ink);
  background: #fff;
}
.data-search input:focus { outline: none; border-color: #bfdbfe; box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.data-filters {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 12px;
  align-items: end;
  padding: 0 14px 14px;
}
.data-filters.is-open { display: grid; }
.data-filters .btn { height: 40px; }
.data-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.data-foot p { margin: 0; }
.table th a.sort { color: var(--muted); font-weight: 700; display: inline-flex; gap: 4px; align-items: baseline; }
.table th a.sort:hover { color: var(--ink); text-decoration: none; }
.sort-mark { min-width: .7em; }
.muted-cell { color: var(--muted); }
tr.is-unsigned td:first-child { box-shadow: inset 3px 0 0 #e11d48; }
.switch {
  width: 36px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #c5ccd6;
  position: relative;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform .16s var(--ease);
}
.switch.is-on { background: #2563eb; }
.switch.is-on::after { transform: translateX(16px); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.icon-link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #3e4c5f;
  border-radius: 8px;
  padding: 0;
}
.icon-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.icon-link:hover { background: #f3f4f6; color: var(--ink); }
.icon-link.is-locked,
.icon-link:disabled { color: #8b95a5; cursor: not-allowed; }
.sheet-form {
  max-width: 36rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
#lembrete-alcance .form-actions { flex-wrap: wrap; gap: 8px; }
#lembrete-alcance .form-actions .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .data-tools { flex-wrap: wrap; }
  .data-search { width: 100%; margin-left: 0; }
  .page-head { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .switch::after { transition: none; }
}

.invoice-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.invoice-top h1 { margin: 0; }
.money-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.money-chip {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}
.money-chip strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.year-select select {
  height: 32px;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  font-weight: 700;
  color: var(--ink);
}
.status-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.status-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.status-card:hover { background: #f8fafc; color: var(--ink); }
.status-card.is-on { background: #f3f6fb; border-color: #c7d7fb; }
.status-card span { font-weight: 700; }
.status-card small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.status-card strong { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--ink); }
.status-card.tom-vermelho span { color: #b42318; }
.status-card.tom-verde span { color: #157a32; }
.status-card.tom-laranja span { color: #9a3412; }
.status-card.tom-ambar span { color: #9a6700; }
.money-chip .tom-verde { color: #157a32; }
.money-chip .tom-vermelho { color: #b42318; }
.money-chip .tom-laranja { color: #9a3412; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}
.pill-parcial { background: #fdecc8; color: #8a5a00; }
.pill-vencida { background: #fde8d0; color: #9a3412; }
.pill-paga { background: #dcf5e4; color: #157a32; }
.pill-aberta { background: #fde8ea; color: #b42318; }
.pill-cancelada { background: #eef0f4; color: #3e4c5f; }
.pages { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pages a,
.pages span {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5dbe5;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.pages a:hover { background: #f3f4f6; color: var(--ink); }
.pages .is-current { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.pages .is-off { color: #6b7280; background: #f8fafc; }
.pages .is-gap { border: 0; background: transparent; min-width: 18px; padding: 0; }
.table td:first-child,
.num { white-space: nowrap; }
.invoice-cell { white-space: normal; }
.invoice-cell > a { font-weight: 700; white-space: nowrap; }
.row-options {
  position: absolute;
  left: -9999px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 2px;
  font-size: 12px;
  font-weight: 600;
}
.row-options a,
.row-options button {
  color: #6b7280;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: none;
}
.row-options button { color: #b42318; cursor: pointer; }
.row-options span { color: #9ca3af; }
table tr:hover .row-options,
.row-options:focus-within { position: static; }
.confirm-dialog {
  border: 0;
  border-radius: 12px;
  padding: 0;
  width: min(100% - 32px, 440px);
  box-shadow: 0 18px 40px rgba(16, 24, 40, .18);
}
.confirm-dialog::backdrop { background: rgba(17, 24, 39, .45); }
.confirm-dialog form { padding: 20px; }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.confirm-dialog p { margin: 0 0 16px; color: var(--muted); }
@media (max-width: 991px) {
  .row-options { position: static; }
}
@media print {
  .sidebar, .topbar, .backdrop, .preview-bar, .pay-box, .confirm-dialog { display: none !important; }
  .shell { margin: 0 !important; }
  .canvas { padding: 0 !important; }
  .sheet { border: 0; box-shadow: none; }
}
.invoice-create { display: grid; gap: 16px; max-width: 100%; }
.invoice-create > * { min-width: 0; }
.invoice-create [hidden] { display: none !important; }
.invoice-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 16px; align-items: start; }
.invoice-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.invoice-create .form-label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.invoice-create .form-label:last-child { margin-bottom: 0; }
.number-lock { display: flex; align-items: center; border: 1px solid #ced4da; border-radius: 6px; overflow: hidden; background: #f8fafc; }
.number-lock span { padding: 7px 10px; font-weight: 700; border-right: 1px solid #ced4da; }
.number-lock input { border: 0; background: transparent; width: 100%; padding: 7px 10px; font-weight: 700; }
.percent-lock { display: flex; align-items: center; border: 1px solid #ced4da; border-radius: 6px; overflow: hidden; background: #fff; }
.percent-lock input { border: 0; flex: 1; min-width: 0; padding: 7px 10px; background: transparent; }
.percent-lock span { padding: 7px 10px; border-left: 1px solid #ced4da; color: #3e4c5f; font-weight: 700; }
.percent-lock:focus-within { border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .2); }
.field-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { margin: -8px 0 14px; color: var(--muted); font-size: 12px; }
#festa-campo .field-hint { margin: 0; }
#festa-campo .field-hint a { font-weight: 700; }
.mode-field { border: 0; margin: 0 0 8px; padding: 0; }
.mode-field legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.mode-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mode-list label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.item-head h2 { margin: 0; font-size: 16px; }
.item-table { table-layout: fixed; width: 100%; }
.item-table .col-item { width: 24%; }
.item-table .col-desc { width: 38%; }
.item-table .col-qty { width: 72px; }
.item-table .col-rate { width: 120px; }
.item-table .col-tax { width: 84px; }
.item-table .col-amount { width: 120px; }
.item-table .col-remove { width: 42px; }
.item-table td:first-child { white-space: normal; }
.item-table td { vertical-align: top; }
.item-table .form-control { min-width: 0; width: 100%; }
.item-table textarea.form-control {
  display: block;
  min-height: 40px;
  max-height: 10.5rem;
  resize: vertical;
  overflow: hidden;
  line-height: 1.45;
  field-sizing: fixed;
}
.tax-cell { color: var(--muted); white-space: nowrap; padding-top: 16px !important; }
.total-box { margin-left: auto; width: min(280px, 100%); display: grid; gap: 8px; margin-top: 14px; }
.total-box div { display: flex; justify-content: space-between; gap: 16px; }
.total-box .is-grand { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
@media (max-width: 991px) {
  .invoice-grid, .field-row.two { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
  .invoice-top { flex-direction: column; }
  .money-row { justify-content: flex-start; }
  .status-cards { grid-template-columns: 1fr 1fr; }
}

html[data-tema="dark"] {
  --ink: #e7edf5;
  --muted: #aeb9c9;
  --line: #2c3544;
  --sidebar: #141a22;
  --canvas: #0e131a;
  --surface: #1a212c;
  --blue: #8eafff;
  color-scheme: dark;
  --bs-body-bg: var(--canvas);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-tertiary-bg: #121820;
  --bs-secondary-bg: var(--surface);
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
}
html[data-tema="dark"] body { background: var(--canvas); color: var(--ink); }
html[data-tema="dark"] .user-card,
html[data-tema="dark"] .account-card,
html[data-tema="dark"] .account-btn,
html[data-tema="dark"] .account-control input,
html[data-tema="dark"] .account-logo img,
html[data-tema="dark"] .summary,
html[data-tema="dark"] .search input,
html[data-tema="dark"] .icon-btn,
html[data-tema="dark"] .table-responsive,
html[data-tema="dark"] .home-card,
html[data-tema="dark"] .pay-stat,
html[data-tema="dark"] .data-card,
html[data-tema="dark"] .sheet,
html[data-tema="dark"] .sheet-form,
html[data-tema="dark"] .invoice-card,
html[data-tema="dark"] .status-card,
html[data-tema="dark"] .cal-cell,
html[data-tema="dark"] .client-list,
html[data-tema="dark"] .festa-money,
html[data-tema="dark"] .percent-lock,
html[data-tema="dark"] .number-lock,
html[data-tema="dark"] .confirm-dialog,
html[data-tema="dark"] .dropdown-menu,
html[data-tema="dark"] .form-control,
html[data-tema="dark"] .form-select,
html[data-tema="dark"] .nav-tabs,
html[data-tema="dark"] .page-link,
html[data-tema="dark"] .btn-outline-dark,
html[data-tema="dark"] .preview-tools .btn,
html[data-tema="dark"] .side-nav > a.is-on,
html[data-tema="dark"] .side-group summary.is-on,
html[data-tema="dark"] .side-group > a.is-on,
html[data-tema="dark"] .nav-tabs .nav-link.active,
html[data-tema="dark"] .page-item.active .page-link,
html[data-tema="dark"] .cal-switch a.is-on {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-tema="dark"] .account-footer,
html[data-tema="dark"] .cal-cell.is-out,
html[data-tema="dark"] .pay-col.is-today,
html[data-tema="dark"] .status-card.is-on,
html[data-tema="dark"] .sheet-table thead th,
html[data-tema="dark"] .sheet-totals .is-bar,
html[data-tema="dark"] .home-expire th,
html[data-tema="dark"] .cal-switch,
html[data-tema="dark"] .dropdown-item:hover,
html[data-tema="dark"] .client-list li.is-active {
  background: #243044;
  color: var(--ink);
}
html[data-tema="dark"] .side-nav > a:hover,
html[data-tema="dark"] .side-group summary:hover,
html[data-tema="dark"] .side-foot button:hover,
html[data-tema="dark"] .status-card:hover,
html[data-tema="dark"] .account-btn:hover,
html[data-tema="dark"] .btn-outline-dark:hover,
html[data-tema="dark"] .page-link:hover {
  background: #243044;
  color: var(--ink);
}
html[data-tema="dark"] .form-control,
html[data-tema="dark"] .form-select,
html[data-tema="dark"] .account-control input,
html[data-tema="dark"] .search input {
  background: #121820;
  color: var(--ink);
  border-color: #334155;
}
html[data-tema="dark"] .form-control::placeholder,
html[data-tema="dark"] .search input::placeholder,
html[data-tema="dark"] .account-control input::placeholder { color: #8b97a8; }
html[data-tema="dark"] .table {
  --bs-table-color: #eef3f8;
  --bs-table-bg: #1b2330;
  --bs-table-border-color: #3d4b60;
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: #31445e;
  --bs-table-accent-bg: transparent;
}
html[data-tema="dark"] .table > :not(caption) > * > * {
  color: #eef3f8;
  background-color: #1b2330;
  border-color: #3d4b60;
  box-shadow: none;
}
html[data-tema="dark"] .table thead th {
  background-color: #3d5578;
  color: #ffffff;
  border-bottom: 1px solid #6d86a8;
}
html[data-tema="dark"] .table tbody td {
  color: #f7fafc;
}
html[data-tema="dark"] .table th a.sort,
html[data-tema="dark"] .table th a.sort:hover { color: #ffffff; }
html[data-tema="dark"] .table tbody tr:nth-child(even) > * { background-color: #222c3c; }
html[data-tema="dark"] .table-hover > tbody > tr:hover > * {
  background-color: #3a5270;
  color: #fff;
}
html[data-tema="dark"] .home-expire th,
html[data-tema="dark"] .home-expire td { border-color: var(--line); color: var(--ink); }
html[data-tema="dark"] .festa-footer,
html[data-tema="dark"] .pay-due,
html[data-tema="dark"] .pay-foot,
html[data-tema="dark"] .number-lock,
html[data-tema="dark"] .invoice-row.is-current,
html[data-tema="dark"] .stat-row a.is-on,
html[data-tema="dark"] .status-card.is-on,
html[data-tema="dark"] .grupo-chip:has(input:checked),
html[data-tema="dark"] .pill-cancelada,
html[data-tema="dark"] .pages .is-off {
  background: #243044;
  color: var(--ink);
}
html[data-tema="dark"] .table a { color: #d7e4ff; }
html[data-tema="dark"] .table a:hover { color: #fff; }
html[data-tema="dark"] .form-label,
html[data-tema="dark"] .festa-field,
html[data-tema="dark"] .account-field,
html[data-tema="dark"] .account-btn,
html[data-tema="dark"] .grupo-chip,
html[data-tema="dark"] .client-list li,
html[data-tema="dark"] .icon-link,
html[data-tema="dark"] .festa-back,
html[data-tema="dark"] .percent-lock span,
html[data-tema="dark"] .number-lock span,
html[data-tema="dark"] .nav-tabs .nav-link {
  color: #f2f6fb;
}
html[data-tema="dark"] .nav-tabs .nav-link.active {
  background: #3d5578;
  color: #ffffff;
}
html[data-tema="dark"] .form-control::placeholder,
html[data-tema="dark"] .search input::placeholder,
html[data-tema="dark"] .festa-field input::placeholder,
html[data-tema="dark"] .festa-field textarea::placeholder,
html[data-tema="dark"] .account-control input::placeholder {
  color: #c5d0de;
}
html[data-tema="dark"] .account-field,
html[data-tema="dark"] .account-save { color: var(--ink); }
html[data-tema="dark"] .account-save { background: #e7edf5; color: #121820; }
html[data-tema="dark"] .btn-dark { background: #e7edf5; border-color: #e7edf5; color: #121820; }
html[data-tema="dark"] .btn-dark:hover { background: #fff; border-color: #fff; color: #121820; }
html[data-tema="dark"] .avatar { background: #243044; color: #dbe7ff; }
html[data-tema="dark"] .brand-mark { background: var(--blue); color: #0e131a; }
html[data-tema="dark"] .side-foot button { border-color: #3a4658; }
html[data-tema="dark"] .dropdown-item { color: var(--ink); }
html[data-tema="dark"] .alert-success { background: #123322; color: #b6f0cb; border-color: #1f6b42; }
html[data-tema="dark"] .alert-danger { background: #3a1717; color: #ffc9c9; border-color: #7f2d2d; }
html[data-tema="dark"] .cal,
html[data-tema="dark"] .cal-filter form,
html[data-tema="dark"] .festa-card,
html[data-tema="dark"] .festa-combo,
html[data-tema="dark"] .grupo-chip,
html[data-tema="dark"] .festa-field input,
html[data-tema="dark"] .festa-field select,
html[data-tema="dark"] .festa-field textarea,
html[data-tema="dark"] .nota-excluir,
html[data-tema="dark"] .login-card,
html[data-tema="dark"] .invoice-list,
html[data-tema="dark"] .pay-box,
html[data-tema="dark"] .stat-row,
html[data-tema="dark"] .money-chip,
html[data-tema="dark"] .page-size select,
html[data-tema="dark"] .year-select select,
html[data-tema="dark"] .data-search input,
html[data-tema="dark"] .pages a,
html[data-tema="dark"] .pages span,
html[data-tema="dark"] .festa-back {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-tema="dark"] .cal-cell { border-color: var(--line); }
html[data-tema="dark"] .cal-dow { color: var(--muted); }
html[data-tema="dark"] .festa-save { background: #e7edf5; color: #121820; }
html[data-tema="dark"] .pay-plot {
  border-bottom-color: #2c3544;
  background-image: repeating-linear-gradient(to top, #2c3544 0 1px, transparent 1px calc(100% / var(--faixas)));
}
@media print {
  html[data-tema="dark"] body,
  html[data-tema="dark"] .sheet,
  html[data-tema="dark"] .sheet-table thead th,
  html[data-tema="dark"] .sheet-totals .is-bar {
    background: #fff !important;
    color: #1c2430 !important;
  }
}
.pay-resumo { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.pay-periodo {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.pay-periodo label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.pay-periodo .form-control { min-height: 38px; }
.pay-board {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .8fr) minmax(150px, .9fr) minmax(150px, .9fr);
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}
.pay-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 16px 18px 14px;
  border-radius: 18px;
  color: #f4fff8;
  background: linear-gradient(115deg, #0a4f34 0%, #0e6b45 58%, #128056 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.pay-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.pay-hero-top p { margin: 0; font-size: 13px; font-weight: 650; }
.pay-hero-top p:last-child { text-align: right; font-weight: 600; opacity: .92; }
.pay-hero > strong {
  display: block;
  margin: 10px 0 14px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.pay-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(244, 255, 248, .35);
}
.pay-split p { margin: 0; }
.pay-split span { display: block; font-size: 12px; font-weight: 600; opacity: .9; }
.pay-split strong { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.pay-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 78px;
  padding: 14px 40px 14px 14px;
  border-radius: 16px;
  overflow: hidden;
}
.pay-kpi p { margin: 0; font-size: 12.5px; font-weight: 700; }
.pay-kpi strong { display: block; margin-top: 4px; font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pay-kpi small { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; }
.pay-kpi svg { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pay-kpi.is-ticket { grid-column: 2; grid-row: 1; background: #173528; color: #d9fbe8; }
.pay-kpi.is-maior { grid-column: 2; grid-row: 2; background: #3a2418; color: #ffe7cf; }
.pay-kpi.is-clientes { grid-column: 3; grid-row: 1 / span 2; background: #243018; color: #e8f6c8; }
.pay-kpi.is-faturas { grid-column: 4; grid-row: 1 / span 2; background: #2c2614; color: #f8e7b8; }
.pay-kpi.is-ticket strong { color: #b6f7cf; }
.pay-kpi.is-maior strong { color: #ffd7b0; }
.pay-kpi.is-clientes strong { color: #dff7a8; }
.pay-kpi.is-faturas strong { color: #ffe3a3; }
.pay-tipos {
  padding: 16px 16px 8px;
  border-radius: 16px;
  background: #171e27;
  color: #f2f6fb;
}
.pay-tipos h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.pay-tipos ul { list-style: none; margin: 0; padding: 0; }
.pay-tipos li { padding: 8px 0 12px; }
.pay-tipos-vazio { margin: 0 0 10px; color: #d5deea; }
.tipo-linha { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tipo-nome { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; }
.tipo-nome svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tipo-linha strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tipo-trilho { display: block; height: 4px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.tipo-barra { display: block; height: 100%; border-radius: inherit; background: #3dbe9a; }
@media (max-width: 1100px) {
  .pay-board { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .pay-hero, .pay-kpi.is-ticket, .pay-kpi.is-maior, .pay-kpi.is-clientes, .pay-kpi.is-faturas {
    grid-column: auto;
    grid-row: auto;
  }
  .pay-hero { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .pay-board { grid-template-columns: 1fr; }
  .pay-hero > strong { font-size: 26px; }
}
