/* ============ TOKENS ============ */
:root {
  --navy-900: #071a3a;
  --navy-800: #0a2147;
  --navy-700: #0d2a58;
  --ink: #0b1f4a;
  --muted: #5a6b8a;
  --line: #e3e9f3;
  --bg: #f2f5fb;
  --card: #ffffff;
  --blue: #0b57d0;
  --blue-600: #094bb5;
  --green: #12a150;
  --green-bg: #dcf5e6;
  --red: #e5383b;
  --red-bg: #fde4e4;
  --purple: #7b5be0;
  --orange: #f0522f;
  --sidebar-w: 16.5rem;
  --radius: 0.875rem;
  --shadow: 0 1px 2px rgba(16, 36, 80, .04), 0 0.375rem 1.125rem rgba(16, 36, 80, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
/* Notebooks: escala toda a interface (tudo está em rem) */
@media (max-width: 1800px) { html { font-size: 12px; } }
@media (max-width: 1440px), (max-height: 850px) and (min-width: 901px) { html { font-size: 11px; } }
@media (max-width: 900px) { html { font-size: 16px; } }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 0.9375rem;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 1.5rem; height: 1.5rem; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 0.375rem; }

/* ============ LAYOUT ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* ============ SIDEBAR ============ */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='360' viewBox='0 0 260 360' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='2'%3E%3Cpath d='M-30 120 90 50l120 70v140L90 330-30 260z'/%3E%3Cpath d='M40 200 130 150l90 50v100l-90 50-90-50z'/%3E%3C/svg%3E")
      no-repeat left bottom / 16.25rem auto,
    linear-gradient(180deg, #0a2250 0%, #071b3d 45%, #06142e 100%);
  color: #b9c6e0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 0.875rem; padding: 1.75rem 0 0 2.5rem; height: 8.5rem; margin-bottom: 2.25rem; }
.brand__mark { width: 4.25rem; height: 4.7rem; }
.brand__text { font-weight: 800; font-size: 1.875rem; line-height: .98; letter-spacing: .06em; color: #fff; }

.sidebar__close { display: none; }

.nav { display: flex; flex-direction: column; gap: 0.25rem; padding: 0 0.875rem 0 0.875rem; margin-top: 0; }
.nav__item {
  display: flex; align-items: center; gap: 1rem;
  height: 3.5rem; padding: 0 1.25rem; border-radius: 0.5rem;
  font-size: 1.0625rem; font-weight: 500; color: #aebcd8;
  transition: background .18s, color .18s;
}
.nav__item svg { width: 1.625rem; height: 1.625rem; }
.nav__item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav__item.is-active { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 0.375rem 1rem rgba(11, 87, 208, .35); }

.sidebar__bottom { margin-top: auto; }
.help { display: flex; align-items: center; gap: 0.875rem; padding: 1.25rem 1.5rem; font-size: 1rem; color: #b9c6e0; border-top: 1px solid rgba(255, 255, 255, .08); margin: 0 0 0; }
.help svg { width: 1.75rem; height: 1.75rem; color: #8c9ab4; }
.usercard { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 1rem 1.25rem 1.375rem; border-top: 1px solid rgba(255, 255, 255, .08); color: #d6e0f3; font-size: 1rem; text-align: left; }
.usercard__name { flex: 1; white-space: nowrap; }
.usercard__chev { width: 1.125rem; height: 1.125rem; }

.avatar {
  display: inline-grid; place-items: center;
  width: 2.375rem; height: 2.375rem; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 0.875rem;
  border: 2px solid rgba(255, 255, 255, .9);
}
.avatar--sm { width: 2.5rem; height: 2.5rem; font-size: 0.95rem; border: 0; background: #0b57d0; }

.overlay { display: none; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  height: 6.25rem; padding: 0 1.375rem 0 2rem;
  background: rgba(255, 255, 255, .55);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(0.625rem);
}
.topbar .menu-btn { display: none; }

.search {
  display: flex; align-items: center; gap: 0.875rem;
  height: 3rem; padding: 0 0.875rem 0 1.125rem;
  background: #fff; border: 1px solid var(--line); border-radius: 0.625rem;
  color: #1a2d57; transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.search svg { width: 1.375rem; height: 1.375rem; color: #1a2d57; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 0.9062rem; }
.search input::placeholder { color: #55678b; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font-family: var(--font); font-size: 0.8125rem; color: #55678b;
  background: #eef2f8; border-radius: 0.375rem; padding: 0.375rem 0.625rem; white-space: nowrap;
}
.search--global { flex: 1; min-width: 0; max-width: 56rem; height: 3.5rem; padding: 0 1rem 0 1.25rem; border-radius: 0.75rem; box-shadow: 0 1px 2px rgba(16, 36, 80, .04); }
.search--global input { font-size: 1rem; }
.search--global svg { width: 1.5rem; height: 1.5rem; }
.search--global kbd { font-size: 0.875rem; padding: 0.4375rem 0.75rem; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 2.25rem; }
.bell { position: relative; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; color: #0b1f4a; }
.bell svg { width: 1.875rem; height: 1.875rem; }
.bell__badge {
  position: absolute; top: -2px; right: -0.25rem;
  min-width: 1.125rem; height: 1.125rem; border-radius: 0.5625rem; padding: 0 0.3125rem;
  background: #ee2b2b; color: #fff; font-size: 0.6875rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
.profile { display: flex; align-items: center; gap: 0.5rem; }
.profile .avatar { width: 2.5rem; height: 2.5rem; border: 0; background: #0b57d0; }
.profile__chev { width: 1.25rem; height: 1.25rem; }

/* ============ CONTENT ============ */
.content { padding: 1.375rem 1.375rem 2rem 2rem; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.375rem; }
.page-head__bar { display: block; width: 1.875rem; height: 3px; border-radius: 2px; background: var(--blue); margin-bottom: 0.375rem; }
.page-head h1 { margin: 0; font-size: 2.75rem; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; color: #0a1c4a; }
.page-head p { margin: 0.375rem 0 0; font-size: 1rem; color: var(--muted); }

.range-wrap { position: relative; margin-top: 1.125rem; }
.range {
  display: flex; align-items: center; gap: 0.875rem;
  height: 3rem; padding: 0 1rem; background: #fff;
  border: 1px solid var(--line); border-radius: 0.625rem;
  font-size: 0.9375rem; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 36, 80, .04);
}
.range__cal { width: 1.375rem; height: 1.375rem; }
.range__chev { width: 1.125rem; height: 1.125rem; margin-left: 0.25rem; }
.range:hover { border-color: #b9cdf0; }

.popover {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 30;
  width: 17.5rem; padding: 1rem; display: grid; gap: 0.75rem;
  background: #fff; border: 1px solid var(--line); border-radius: 0.75rem;
  box-shadow: 0 1.125rem 2.5rem rgba(16, 36, 80, .18);
}
.popover label, .form-grid label { display: grid; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.popover input, .form-grid input, .form-grid select {
  height: 2.625rem; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; font-size: 0.9062rem; color: var(--ink); font-weight: 400;
}
.popover input:focus, .form-grid input:focus, .form-grid select:focus { outline: 0; border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.popover__actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  height: 2.75rem; padding: 0 1.125rem; border-radius: 0.5625rem; font-weight: 600; font-size: 0.9062rem;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 0.25rem 0.75rem rgba(11, 87, 208, .28); }
.btn--primary:hover { background: var(--blue-600); }
.btn--ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { background: #f5f8fd; }
.btn svg { width: 1.25rem; height: 1.25rem; }
.icon-btn { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 0.625rem; color: var(--ink); }
.icon-btn:hover { background: rgba(11, 31, 74, .06); }
.icon-btn--box { width: 3rem; height: 3rem; background: #fff; border: 1px solid var(--line); }
.icon-btn--box svg { width: 1.375rem; height: 1.375rem; }

/* ============ KPI CARDS ============ */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.125rem; margin-bottom: 1.875rem; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fff, #fbfcff);
  border: 1px solid rgba(227, 233, 243, .8); border-radius: var(--radius);
  padding: 1rem 1rem 0.875rem; min-height: 12.875rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.kpi__icon { width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 0.875rem; }
.kpi__icon svg { width: 1.6875rem; height: 1.6875rem; }
.kpi__icon--blue { background: #1d5fd1; box-shadow: 0 0.375rem 0.875rem rgba(29, 95, 209, .3); }
.kpi__icon--green { background: #12a150; box-shadow: 0 0.375rem 0.875rem rgba(18, 161, 80, .3); }
.kpi__icon--purple { background: #7b5be0; box-shadow: 0 0.375rem 0.875rem rgba(123, 91, 224, .3); }
.kpi__icon--red { background: #f0522f; box-shadow: 0 0.375rem 0.875rem rgba(240, 82, 47, .3); }
.kpi__label { font-size: 1rem; font-weight: 500; color: #1d3158; }
.kpi__value { font-size: 1.875rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0.375rem 0 0.625rem; color: #0a1c4a; white-space: nowrap; }
.kpi__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; }
.kpi__delta { display: flex; align-items: center; gap: 0.25rem; font-weight: 700; font-size: 0.9375rem; color: var(--green); }
.kpi__delta svg { width: 1rem; height: 1rem; }
.kpi__delta--down { color: var(--red); }
.kpi__sub { display: block; margin-top: 3px; font-size: 0.7812rem; color: var(--muted); font-weight: 400; white-space: nowrap; }
.kpi__spark { width: 4.375rem; height: 2.875rem; margin-right: -0.25rem; flex: none; }

.hide-kpis .kpis { display: none; }

/* ============ CLIENTES ============ */
#view-clientes .table { min-width: 62rem; }
.select {
  height: 3rem; padding: 0 2.25rem 0 1rem; border: 1px solid var(--line); border-radius: 0.625rem; background-color: #fff;
  font-size: 0.9062rem; color: var(--ink); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2d57' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.125rem;
}
.select:focus { outline: 0; border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.client { display: flex; align-items: center; gap: 0.75rem; }
.client__avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 700; flex: none; }
.client__info { display: grid; line-height: 1.25; }
.client__info strong { font-weight: 600; }
.client__info small { font-size: 0.8125rem; color: var(--muted); font-weight: 400; }
/* ============ CONFIGURAÇÕES ============ */
.settings { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.settings__nav { display: grid; gap: 0.25rem; padding: 0.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 7.5rem; }
.settings__nav button { display: flex; align-items: center; gap: 0.75rem; height: 2.75rem; padding: 0 0.875rem; border-radius: 0.5rem; font-size: 0.9375rem; font-weight: 500; color: #28406e; text-align: left; white-space: nowrap; transition: background .15s, color .15s; }
.settings__nav button svg { width: 1.25rem; height: 1.25rem; }
.settings__nav button:hover { background: #f1f5fc; }
.settings__nav button.is-active { background: #e8f0ff; color: var(--blue); font-weight: 600; }
.set-panel { padding: 0; overflow: hidden; }
.set-panel__head { padding: 1.375rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.set-panel__head h2 { margin: 0; font-size: 1.25rem; color: #0a1c4a; }
.set-panel__head p { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }
.set-panel .form-grid { padding: 1.5rem; }
.set-panel .form-grid input:disabled, .set-panel .form-grid select:disabled { background: #f4f6fa; color: var(--muted); cursor: not-allowed; }
.set-actions { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: #fafbfe; }
.hint { margin: -0.5rem 1.5rem 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem 0; }
.profile-card > div { display: grid; gap: 0.125rem; }
.profile-card strong { font-size: 1.0625rem; }
.profile-card span:not(.avatar) { font-size: 0.875rem; color: var(--muted); }
.avatar--lg { width: 4.25rem; height: 4.25rem; font-size: 1.375rem; border: 0; background: var(--blue); box-shadow: 0 6px 16px rgba(11, 87, 208, .3); }
.rows { padding: 0 1.5rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.125rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row strong { display: block; font-size: 0.9375rem; }
.row span { font-size: 0.8125rem; color: var(--muted); }
.row .select { flex: none; min-width: 5.5rem; }
.switch { position: relative; flex: none; width: 2.75rem; height: 1.5rem; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 1rem; background: #cfd8e8; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 36, 80, .3); transition: transform .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(1.25rem); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ============ RELATÓRIOS ============ */
.report-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 0.625rem; margin-top: 0.5rem; }
.datefield { display: grid; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.datefield input { height: 3rem; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0.625rem; background: #fff; font-size: 0.9062rem; color: var(--ink); }
.datefield input:focus { outline: 0; border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.report-tools .btn { height: 3rem; }
.kpi--report { min-height: 0; }
.kpi--report .kpi__value { margin-bottom: 0.375rem; }

.report-grid { display: grid; gap: 1.125rem; margin-bottom: 1.125rem; }
.report-grid--a { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.report-grid--b { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.panel { padding: 1.25rem; min-width: 0; }
.panel--table { padding: 1.25rem 0 0; overflow: hidden; }
.panel--table .panel__head { padding: 0 1.25rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel__head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; color: #0a1c4a; }
.panel__hint { font-size: 0.8125rem; color: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: 0.8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.legend i { width: 0.625rem; height: 0.625rem; border-radius: 3px; }

.chart { display: flex; gap: 0.75rem; }
.chart__y { display: flex; flex-direction: column; justify-content: space-between; height: 14rem; text-align: right; font-size: 0.75rem; color: var(--muted); white-space: nowrap; transform: translateY(-0.5em); padding-bottom: 0; }
.chart__plot { position: relative; flex: 1; min-width: 0; overflow-x: auto; }
.chart__grid { position: absolute; left: 0; right: 0; top: 0; height: 14rem; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart__grid i { display: block; height: 1px; background: var(--line); }
.chart__cols { position: relative; display: flex; align-items: flex-end; gap: 0.5rem; width: 100%; }
.col { flex: 1; min-width: 2rem; }
.col__bars { height: 14rem; display: flex; align-items: flex-end; justify-content: center; gap: 0.1875rem; }
.col__bars b { display: block; width: 36%; max-width: 1.5rem; min-height: 2px; background: #1d5fd1; border-radius: 4px 4px 0 0; transition: opacity .15s; }
.col__bars b.net { background: #9fc0f5; }
.col:hover .col__bars b { opacity: .8; }
.col small { display: block; margin-top: 0.5rem; text-align: center; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.donut-wrap { display: grid; gap: 1.25rem; justify-items: center; }
.donut { position: relative; width: 11rem; height: 11rem; }
.donut svg { width: 100%; height: 100%; }
.donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut__center strong { font-size: 1.75rem; font-weight: 800; color: #0a1c4a; line-height: 1; }
.donut__center span { font-size: 0.8125rem; color: var(--muted); }
.donut__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; width: 100%; }
.donut__legend li { display: flex; align-items: center; gap: 0.75rem; }
.donut__legend i { width: 0.75rem; height: 0.75rem; border-radius: 50%; flex: none; }
.donut__legend strong { display: block; font-size: 0.9375rem; }
.donut__legend span { font-size: 0.8125rem; color: var(--muted); }

.hbars { display: grid; gap: 1rem; }
.hbar__top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.9062rem; margin-bottom: 0.375rem; }
.hbar__top span { display: inline-flex; align-items: center; gap: 0.625rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__top em { font-style: normal; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #e8f0ff; color: var(--blue); font-size: 0.75rem; font-weight: 700; flex: none; }
.hbar__top strong { font-weight: 700; white-space: nowrap; }
.hbar__track { height: 0.5rem; border-radius: 0.25rem; background: #edf1f8; overflow: hidden; }
.hbar__track i { display: block; height: 100%; border-radius: 0.25rem; background: linear-gradient(90deg, #1d5fd1, #4b8bf5); }

.table--compact { min-width: 34rem; }
.table--compact th { height: 3.25rem; }
.table--compact td { height: 3rem; }
.row-total td { font-weight: 700; background: #f6f8fc; }
.share { display: inline-block; vertical-align: middle; width: 3.5rem; height: 0.375rem; border-radius: 0.25rem; background: #edf1f8; margin-right: 0.5rem; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--green); }

.muted { color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.875rem; padding: 0.375rem 0.375rem 0.375rem 0.875rem;
  background: #e8f0ff; color: #0b3a8c; border: 1px solid #c6d9fb; border-radius: 1.25rem; font-size: 0.875rem; font-weight: 600;
}
.chip button { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; color: #0b3a8c; }
.chip button:hover { background: rgba(11, 87, 208, .15); }
.chip svg { width: 1rem; height: 1rem; }
.pill--idle { background: #eceff5; color: #55678b; }
.pill--idle i { background: #8e9bb5; }

/* ============ TOOLBAR ============ */
.toolbar { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.search--table { flex: 1; font-size: 0.9062rem; }
.btn--new { height: 3rem; padding: 0 1.375rem; font-size: 0.9375rem; box-shadow: 0 0.375rem 1rem rgba(11, 87, 208, .3); white-space: nowrap; }
.btn--new svg { width: 1.375rem; height: 1.375rem; }

/* ============ TABLE ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 64rem; font-size: 0.9375rem; }
.table th {
  height: 4.375rem; padding: 0 0.75rem; text-align: left; font-weight: 600; font-size: 0.9062rem; color: #12285a;
  background: #f6f8fc; border-bottom: 1px solid var(--line); line-height: 1.25; white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 1rem; }
.table td { height: 3.0312rem; padding: 0 0.75rem; border-bottom: 1px solid var(--line); color: #0f2250; white-space: nowrap; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f8fafe; }
.table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.th-actions, .td-actions { width: 3.5rem; text-align: center; padding: 0 !important; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 2rem; padding: 0 1rem 0 0.3125rem; border-radius: 1rem;
  font-size: 0.9062rem; font-weight: 500;
}
.pill i { width: 1.375rem; height: 1.375rem; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pill i svg { width: 0.8125rem; height: 0.8125rem; }
.pill--paid { background: var(--green-bg); color: #0f7a3f; }
.pill--paid i { background: var(--green); }
.pill--unpaid { background: var(--red-bg); color: #c62828; }
.pill--unpaid i { background: var(--red); }

.kebab { width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; display: inline-grid; place-items: center; color: #0f2250; }
.kebab:hover { background: #eef2f9; }
.kebab svg { width: 1.25rem; height: 1.25rem; }
.kebab-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 15; min-width: 11.25rem; padding: 0.375rem;
  background: #fff; border: 1px solid var(--line); border-radius: 0.625rem; box-shadow: 0 0.875rem 2rem rgba(16, 36, 80, .18); text-align: left;
}
.menu button { display: block; width: 100%; text-align: left; padding: 0.5625rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; }
.menu button:hover { background: #f1f5fc; }
.menu .danger { color: var(--red); }

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1.125rem 1rem; color: #28406e; font-size: 0.9062rem; }
.pager { display: flex; gap: 0.5rem; }
.pager button {
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.625rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; font-weight: 600; font-size: 0.875rem; color: #12285a;
}
.pager button:hover:not(:disabled) { background: #f1f5fc; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager button svg { width: 1.125rem; height: 1.125rem; }
.pager button.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ============ MODAL / TOAST ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 20, 46, .55); backdrop-filter: blur(2px); }
.modal__box { position: relative; width: min(32.5rem, 100%); max-height: 100%; overflow: auto; background: #fff; border-radius: 1rem; box-shadow: 0 1.875rem 4.375rem rgba(6, 20, 46, .4); animation: pop .18s ease-out; }
.modal__box header, .modal__box footer { display: flex; align-items: center; justify-content: space-between; padding: 1.125rem 1.375rem; }
.modal__box header { border-bottom: 1px solid var(--line); }
.modal__box h2 { margin: 0; font-size: 1.25rem; }
.modal__box footer { justify-content: flex-end; gap: 0.625rem; border-top: 1px solid var(--line); }
.upload {
  display: flex; align-items: center; gap: 1rem; margin: 1.375rem 1.375rem 0; padding: 1rem 1.125rem;
  border: 1.5px dashed #9db9e8; border-radius: 0.75rem; background: #f5f9ff; transition: background .15s, border-color .15s;
}
.upload.is-over { background: #e6f0ff; border-color: var(--blue); }
.upload__icon { width: 2.5rem; height: 2.5rem; color: #12a150; flex: none; }
.upload__text { flex: 1; min-width: 0; display: grid; gap: 0.125rem; font-size: 0.8125rem; color: var(--muted); }
.upload__text strong { font-size: 0.9375rem; color: var(--ink); }
.upload__btn { flex: none; white-space: nowrap; border-color: #b9cdf0; }
.link { justify-self: start; color: var(--blue); font-weight: 600; font-size: 0.8125rem; text-decoration: underline; padding: 0.25rem 0 0; }
.or { display: flex; align-items: center; gap: 0.75rem; margin: 1.125rem 1.375rem 0; color: var(--muted); font-size: 0.8125rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.375rem; }
.form-grid .full { grid-column: 1 / -1; }
@keyframes pop { from { opacity: 0; transform: translateY(0.5rem) scale(.98); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 120; transform: translate(-50%, 1.25rem);
  background: #0a1c4a; color: #fff; padding: 0.75rem 1.25rem; border-radius: 0.625rem; font-size: 0.875rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
  .kpi__value { font-size: 1.625rem; }
  .page-head h1 { font-size: 2.375rem; }
}

@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings__nav { position: static; display: flex; overflow-x: auto; }
  .settings__nav button { flex: none; }
}

@media (max-width: 1100px) {
  .report-grid--a, .report-grid--b { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 11.875rem; }
  .kpi__spark { width: 6.25rem; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 16.5rem;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: none;
  }
  .sidebar.is-open { transform: none; box-shadow: 1.25rem 0 3.75rem rgba(6, 20, 46, .45); }
  .sidebar__close { display: grid; place-items: center; position: absolute; right: 0.625rem; top: 0.625rem; width: 2.5rem; height: 2.5rem; color: #b9c6e0; border-radius: 0.5rem; }
  .sidebar__close:hover { background: rgba(255, 255, 255, .08); }
  .overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(6, 20, 46, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .overlay.is-open { opacity: 1; pointer-events: auto; }
  .topbar .menu-btn { display: grid; flex: none; }
  .topbar { padding: 0 1.25rem; gap: 0.75rem; height: 4.75rem; }
  .search kbd { display: none; }
  .topbar__right { gap: 1.375rem; }
  .content { padding: 1.25rem; }
}

@media (max-width: 760px) {
  .page-head { flex-direction: column; gap: 0.875rem; }
  .range-wrap { margin-top: 0; width: 100%; }
  .range { width: 100%; }
  .range__chev { margin-left: auto; }
  .popover { left: 0; right: 0; width: auto; }
  .page-head h1 { font-size: 2rem; }
  .page-head p { font-size: 0.9375rem; }

  /* table -> cards */
  .table { min-width: 0; display: block; }
  .table thead { display: none; }
  .table tbody { display: grid; gap: 0; }
  .table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem 0.875rem; position: relative;
    padding: 1rem 3.25rem 1rem 1rem; border-bottom: 1px solid var(--line);
  }
  .table td { display: block; height: auto; padding: 0 !important; border: 0 !important; white-space: normal; }
  .table td::before {
    content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px;
  }
  #view-clientes .table { min-width: 0; }
  .report-tools { justify-content: flex-start; width: 100%; margin-top: 0; }
  .report-tools .datefield { flex: 1; }
  .report-tools .btn { flex: 1 1 100%; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .table--compact { min-width: 0; }
  .table--compact tr { padding-right: 1rem; }
  .row-total { background: #f6f8fc; }
  .table td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: 1rem; }
  .table td:first-child::before { display: none; }
  .table td.td-status { grid-column: 1 / -1; }
  .table td.td-actions { position: absolute; right: 0.5rem; top: 0.75rem; width: auto; }
  .table td.td-actions::before { display: none; }
  .table-foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; gap: 0.875rem; margin-bottom: 1.375rem; }
  .kpi { min-height: 0; padding: 1rem; }
  .kpi__icon { margin-bottom: 0.625rem; }
  .toolbar { flex-wrap: wrap; }
  .search--table { flex: 1 1 100%; }
  .icon-btn--box { order: 2; }
  .toolbar .select { flex: 1; order: 2; }
  .btn--new { order: 3; flex: 1; }
  .search--global span, .search--global kbd { display: none; }
  .topbar { padding: 0 0.875rem; gap: 0.5rem; }
  .search--global { padding: 0 0.75rem; gap: 0.625rem; }
  .topbar__right { gap: 0.875rem; margin-left: 0; }
  .profile__chev { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .upload { flex-wrap: wrap; }
  .upload__btn { width: 100%; }
  .content { padding: 1rem; }
}

/* ============ BANCO / ERRO DE CONEXÃO ============ */
.kpi__delta--none { color: var(--muted); }
.kpi__delta svg.flip { transform: rotate(90deg); }
.fatal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); text-align: center; }
.fatal > div { max-width: 28rem; display: grid; gap: 0.75rem; justify-items: center; }
.fatal h2 { margin: 0; font-size: 1.375rem; color: #0a1c4a; }
.fatal p { margin: 0; color: var(--muted); }
.fatal code { background: #e8eef9; padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.875em; }

/* ============ LOGIN ============ */
.booting .app { visibility: hidden; }
.auth-open .app { display: none; }
.auth {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.25rem; overflow: auto;
  background:
    radial-gradient(60rem 40rem at 15% 10%, rgba(11, 87, 208, .35), transparent 60%),
    linear-gradient(160deg, #0a2250 0%, #071b3d 55%, #06142e 100%);
}
.auth__card {
  width: min(26rem, 100%); display: grid; gap: 0.875rem; padding: 2rem 1.75rem 1.75rem;
  background: #fff; border-radius: 1rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.auth__brand { display: flex; align-items: center; justify-content: center; gap: 0.75rem; color: #0a1c4a; margin-bottom: 0.25rem; }
.auth__brand svg { width: 3.25rem; height: 3.6rem; }
.auth__brand span { font-weight: 800; font-size: 1.625rem; line-height: .98; letter-spacing: .06em; }
.auth__card h1 { margin: 0.25rem 0 0; font-size: 1.5rem; text-align: center; color: #0a1c4a; }
.auth__sub { margin: 0 0 0.5rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
.auth__card label { display: grid; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.auth__card input:not([type="checkbox"]) {
  width: 100%; height: 2.875rem; padding: 0 0.875rem; border: 1px solid var(--line); border-radius: 0.5rem;
  font-size: 0.9375rem; color: var(--ink); background: #fff;
}
.auth__card input:focus { outline: 0; border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.auth__pass { position: relative; display: block; }
.auth__pass input { padding-right: 2.75rem !important; }
.auth__eye { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; font-size: 1rem; opacity: .6; }
.auth__eye:hover { opacity: 1; background: #eef2f9; }
.auth .auth__check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.auth__hint { margin-top: -0.375rem; color: var(--muted); font-size: 0.8125rem; }
.auth__error { padding: 0.625rem 0.75rem; border-radius: 0.5rem; background: var(--red-bg); color: #b71c1c; font-size: 0.875rem; font-weight: 500; }
.auth__submit { height: 3rem; margin-top: 0.25rem; font-size: 1rem; }
.auth__submit:disabled { opacity: .7; cursor: wait; }

/* menu do perfil (topo) */
.profile-wrap { position: relative; }
.profile-menu { min-width: 13rem; right: 0; top: calc(100% + 0.5rem); }
.profile-menu__who { display: grid; gap: 0.125rem; padding: 0.625rem 0.75rem 0.75rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
.profile-menu__who span { font-size: 0.8125rem; color: var(--muted); }
.logout { width: 100%; border-top: 0 !important; padding-top: 0.25rem !important; text-align: left; }

/* ============ LOJA / CARRINHO ============ */
.cart-btn { margin-right: -0.5rem; }
.cart-btn svg { width: 1.75rem; height: 1.75rem; }
.shop-toolbar { align-items: center; flex-wrap: wrap; }
.shop-toolbar .search { flex: 1; min-width: 14rem; }
.segmented { display: inline-flex; padding: 0.25rem; gap: 0.25rem; background: #e8edf6; border-radius: 0.75rem; }
.segmented button { height: 2.5rem; padding: 0 1rem; border-radius: 0.5rem; font-size: 0.9375rem; font-weight: 600; color: #28406e; display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.segmented button em { font-style: normal; min-width: 1.5rem; padding: 0.125rem 0.4rem; border-radius: 0.75rem; background: rgba(11, 31, 74, .08); font-size: 0.75rem; text-align: center; }
.segmented button.is-active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 36, 80, .15); }
.segmented button.is-active em { background: #e8f0ff; }

.notice { margin: 0 0 1rem; padding: 0.875rem 1rem; border-radius: 0.625rem; font-size: 0.9375rem; font-weight: 500; border: 1px solid; }
.notice--info { background: #eaf2ff; color: #0b3a8c; border-color: #c6d9fb; }
.notice--ok { background: var(--green-bg); color: #0f7a3f; border-color: #b7e6c9; }
.notice--error { background: var(--red-bg); color: #b71c1c; border-color: #f6c1c1; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1.125rem; }
.shop-empty { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.shop-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.125rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.shop-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 36, 80, .12); }
.shop-card.is-in-cart { border-color: #8db3f3; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.shop-card__top { display: flex; align-items: center; justify-content: space-between; }
.shop-card__icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #1d5fd1; box-shadow: 0 6px 14px rgba(29, 95, 209, .3); }
.shop-card__icon svg { width: 1.375rem; height: 1.375rem; }
.shop-card h3 { margin: 0.375rem 0 0; font-size: 1.0625rem; color: #0a1c4a; }
.shop-card h3 small, .cart-item small { font-weight: 500; color: var(--muted); font-size: 0.8125rem; }
.shop-card__client { margin: 0; font-size: 0.875rem; color: var(--muted); }
.shop-card { min-width: 0; }
.shop-card__meta { margin: 0.375rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shop-card__meta > div { min-width: 0; }
.shop-card__meta dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.shop-card__meta dd { margin: 0.125rem 0 0; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.shop-card__buy { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.625rem 0.75rem; }
.shop-card__price { flex: 1 1 auto; min-width: 0; }
.shop-card__price span { display: block; font-size: 0.75rem; color: var(--muted); }
.shop-card__price strong { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; color: #0a1c4a; white-space: nowrap; }
.shop-card .btn { height: 2.75rem; flex: 0 0 auto; white-space: nowrap; padding: 0 1rem; margin-left: auto; }

.btn--sm { height: 2.25rem; padding: 0 0.875rem; font-size: 0.8125rem; white-space: nowrap; }
.btn--danger { color: var(--red); border-color: #f1c4c4; }
.btn--danger:hover { background: var(--red-bg) !important; }
#payHistory .th-actions, #payHistory .td-actions { width: auto; padding: 0 1rem !important; text-align: right; white-space: nowrap; }
#payHistory .td-actions .btn + .btn { margin-left: 0.375rem; }

/* gaveta do carrinho */
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(6, 20, 46, .5); opacity: 0; transition: opacity .25s; }
.drawer-overlay.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(26rem, 100%); display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 60px rgba(6, 20, 46, .3); transform: translateX(105%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 1.25rem; }
.drawer__head h2 span { color: var(--muted); font-weight: 500; font-size: 1rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 0.5rem 1.5rem; }
.drawer__foot { display: grid; gap: 0.75rem; padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); background: #fafbfe; }
.drawer__total { display: flex; align-items: baseline; justify-content: space-between; }
.drawer__total span { color: var(--muted); }
.drawer__total strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.drawer__pay { height: 3rem; font-size: 1rem; }
.drawer__pay:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.drawer__foot .link { justify-self: center; color: var(--muted); }
.cart-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.75rem; padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.cart-item__info { display: grid; gap: 0.125rem; min-width: 0; }
.cart-item__info span { font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item__price { font-weight: 700; white-space: nowrap; }
.cart-item .icon-btn { width: 2.25rem; height: 2.25rem; }
.cart-item .icon-btn svg { width: 1.125rem; height: 1.125rem; }
.cart-empty { display: grid; justify-items: center; gap: 0.5rem; padding: 3rem 1rem; text-align: center; color: var(--muted); }
.cart-empty svg { width: 3rem; height: 3rem; opacity: .4; }
.cart-empty p { margin: 0; font-weight: 600; color: var(--ink); }

/* modal de pagamento */
.pay-body { padding: 1.25rem 1.5rem; display: grid; gap: 0.875rem; }
.pay-warn { margin: 0; padding: 0.625rem 0.75rem; border-radius: 0.5rem; background: #fff6e0; color: #8a5a00; font-size: 0.8125rem; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; }
.pay-total strong { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.pay-items { list-style: none; margin: 0; padding: 0; max-height: 12rem; overflow-y: auto; border-top: 1px solid var(--line); }
.pay-items li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.pay-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.625rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  #payHistory td.td-actions { position: static; grid-column: 1 / -1; text-align: left; padding: 0 !important; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; justify-content: center; padding: 0 0.5rem; }
  .shop-grid { grid-template-columns: 1fr; }
}

/* ============ TELA DE PAGAMENTOS (histórico) ============ */
.pill--wait { background: #fff1d6; color: #8a5a00; }
.pill--wait i { background: #f0a020; }

.pay-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.125rem; margin-bottom: 1.25rem; }
.pay-stat { display: flex; align-items: center; gap: 1rem; padding: 1.125rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.pay-stat__icon { flex: none; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pay-stat__icon svg { width: 1.5rem; height: 1.5rem; }
.pay-stat__icon--green { background: #12a150; box-shadow: 0 6px 14px rgba(18, 161, 80, .3); }
.pay-stat__icon--amber { background: #f0a020; box-shadow: 0 6px 14px rgba(240, 160, 32, .3); }
.pay-stat__icon--blue { background: #1d5fd1; box-shadow: 0 6px 14px rgba(29, 95, 209, .3); }
.pay-stat > div { display: grid; gap: 0.125rem; min-width: 0; }
.pay-stat__label { font-size: 0.875rem; color: var(--muted); font-weight: 500; }
.pay-stat strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: #0a1c4a; white-space: nowrap; }
.pay-stat small { font-size: 0.8125rem; color: var(--muted); }

.pay-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pay-filter button { height: 2.25rem; padding: 0 1rem; border-radius: 1.25rem; border: 1px solid var(--line); background: #fff; font-size: 0.875rem; font-weight: 600; color: #28406e; transition: background .15s, color .15s, border-color .15s; }
.pay-filter button:hover { background: #f1f5fc; }
.pay-filter button.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.pay-list { display: grid; gap: 0.875rem; }
.pay-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 1.125rem 1.25rem; background: #fff; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); box-shadow: var(--shadow); }
.pay-card--approved { border-left-color: #12a150; }
.pay-card--pending { border-left-color: #f0a020; }
.pay-card--rejected { border-left-color: #e5383b; }
.pay-card--cancelled { border-left-color: #b4bfd3; }
.pay-card__icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #b4bfd3; }
.pay-card__icon svg { width: 1.375rem; height: 1.375rem; }
.pay-card--approved .pay-card__icon { background: #12a150; }
.pay-card--pending .pay-card__icon { background: #f0a020; }
.pay-card--rejected .pay-card__icon { background: #e5383b; }
.pay-card__main { min-width: 0; display: grid; gap: 0.375rem; }
.pay-card__title { display: flex; align-items: center; flex-wrap: wrap; gap: 0.625rem; }
.pay-card__title strong { font-size: 1.0625rem; color: #0a1c4a; }
.pay-card__title .pill { height: 1.625rem; padding: 0 0.75rem; font-size: 0.8125rem; font-weight: 600; }
.pay-card__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8125rem; color: var(--muted); }
.pay-card__meta span + span::before { content: "•"; margin-right: 1rem; color: #b4bfd3; }
.pay-card__items summary { cursor: pointer; width: fit-content; font-size: 0.8125rem; font-weight: 600; color: var(--blue); list-style: none; padding: 0.125rem 0; }
.pay-card__items summary::-webkit-details-marker { display: none; }
.pay-card__items summary::after { content: " ▾"; }
.pay-card__items[open] summary::after { content: " ▴"; }
.pay-card__items ul { list-style: none; margin: 0.5rem 0 0; padding: 0.25rem 0.875rem; background: #f6f8fc; border-radius: 0.625rem; }
.pay-card__items li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.875rem; border-bottom: 1px solid var(--line); }
.pay-card__items li:last-child { border-bottom: 0; }
.pay-card__items small { color: var(--muted); }
.pay-card__side { display: grid; justify-items: end; gap: 0.625rem; text-align: right; }
.pay-card__total span { display: block; font-size: 0.75rem; color: var(--muted); }
.pay-card__total strong { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; color: #0a1c4a; white-space: nowrap; }
.pay-card--cancelled .pay-card__total strong, .pay-card--rejected .pay-card__total strong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.pay-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }

/* modal de pagamento mais organizado */
.pay-total { padding: 0.875rem 1rem; background: #f6f8fc; border-radius: 0.75rem; }
.pay-items li:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .pay-summary { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
}
@media (max-width: 760px) {
  .pay-card { grid-template-columns: auto minmax(0, 1fr); padding: 1rem; }
  .pay-card__side { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: start; text-align: left; padding-top: 0.75rem; border-top: 1px solid var(--line); }
  .pay-card__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pay-card__actions .btn { flex: 1; }
  .pay-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; }
  .pay-filter button { flex: none; }
}

/* ============ JANELA DE PAGAMENTO (PIX) ============ */
.modal__box--pix { width: min(42rem, 100%); }
.pix-header { padding: 1rem 1.25rem 1rem 1.5rem !important; }
.pix-header__title { display: flex; align-items: center; gap: 0.75rem; }
.pix-header__title h2 { font-size: 1.125rem !important; }
.pix-logo { display: inline-grid; place-items: center; height: 1.75rem; padding: 0 0.625rem; border-radius: 0.5rem; background: #32bcad; color: #fff; font-size: 0.8125rem; font-weight: 800; letter-spacing: .08em; }

.pix { padding: 1.25rem 1.5rem 0.5rem; display: grid; gap: 1.125rem; }
.pix-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.625rem 0.875rem; border-radius: 0.625rem; background: #fff6e0; color: #8a5a00; font-size: 0.9375rem; font-weight: 600; }
.pix-status__dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: #f0a020; box-shadow: 0 0 0 0 rgba(240, 160, 32, .6); animation: pixpulse 1.6s infinite; }
.pix-status__timer { margin-left: auto; font-weight: 500; }
.pix-status__timer b { font-variant-numeric: tabular-nums; font-size: 1.0625rem; }
.pix-status__timer.is-low { color: #c62828; }
@keyframes pixpulse { 0% { box-shadow: 0 0 0 0 rgba(240, 160, 32, .55); } 70% { box-shadow: 0 0 0 0.5rem rgba(240, 160, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 160, 32, 0); } }

.pix-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.pix-qr { position: relative; width: 13rem; height: 13rem; padding: 0.875rem; background: #fff; border: 1px solid var(--line); border-radius: 0.875rem; box-shadow: var(--shadow); display: grid; place-items: center; }
.pix-qr svg, .pix-qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.pix-qr__off { text-align: center; font-size: 0.8125rem; color: var(--muted); }
.pix-qr__tag { position: absolute; left: 50%; bottom: -0.625rem; transform: translateX(-50%); padding: 0.1875rem 0.625rem; border-radius: 1rem; background: #f0a020; color: #fff; font-size: 0.6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }

.pix-info { display: grid; gap: 0.25rem; min-width: 0; }
.pix-info__label { font-size: 0.8125rem; color: var(--muted); }
.pix-info__amount { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: #0a1c4a; white-space: nowrap; line-height: 1.1; }
.pix-info__sub { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.5rem; }
.pix-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 0.5rem; }
.pix-steps li { counter-increment: s; position: relative; padding-left: 1.875rem; font-size: 0.8125rem; line-height: 1.35; color: #28406e; }
.pix-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.375rem; height: 1.375rem; border-radius: 50%; display: grid; place-items: center; background: #e8f0ff; color: var(--blue); font-size: 0.75rem; font-weight: 700; }

.pix-copy label { display: block; margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.pix-copy__row { display: flex; gap: 0.5rem; }
.pix-copy__row input { flex: 1; min-width: 0; height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--line); border-radius: 0.5rem; background: #f6f8fc; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.75rem; color: #28406e; text-overflow: ellipsis; }
.pix-copy__row .btn { height: 2.75rem; white-space: nowrap; flex: none; }
.pix-copy__row .btn.is-done { background: #12a150; box-shadow: none; }

.pix-items summary { cursor: pointer; width: fit-content; font-size: 0.875rem; font-weight: 600; color: var(--blue); list-style: none; }
.pix-items summary::-webkit-details-marker { display: none; }
.pix-items summary::after { content: " ▾"; }
.pix-items[open] summary::after { content: " ▴"; }
.pix-items ul { list-style: none; margin: 0.5rem 0 0; padding: 0.25rem 0.875rem; max-height: 10rem; overflow-y: auto; background: #f6f8fc; border-radius: 0.625rem; }
.pix-items li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.875rem; border-bottom: 1px solid var(--line); }
.pix-items li:last-child { border-bottom: 0; }
.pix-items small { color: var(--muted); }

.pix-sim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0.875rem; border: 1px dashed #e0b45a; border-radius: 0.625rem; background: #fffaf0; font-size: 0.8125rem; color: #8a5a00; }
.pix-sim > div:first-child { display: grid; gap: 0.125rem; }
.pix-sim__btns { display: flex; gap: 0.5rem; }

.pix-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.625rem; padding: 1rem 1.5rem; margin-top: 0.5rem; border-top: 1px solid var(--line); }
.pix-foot--split { justify-content: space-between; }
.link--danger { color: var(--red); }

.pix-result { display: grid; justify-items: center; gap: 0.5rem; padding: 2rem 1.5rem 1rem; text-align: center; }
.pix-result h3 { margin: 0.5rem 0 0; font-size: 1.375rem; color: #0a1c4a; }
.pix-result p { margin: 0; color: var(--muted); max-width: 28rem; }
.pix-result__icon { width: 4.5rem; height: 4.5rem; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pix-result__icon svg { width: 2.25rem; height: 2.25rem; }
.pix-result--ok .pix-result__icon { background: #12a150; box-shadow: 0 0 0 0.5rem rgba(18, 161, 80, .15); animation: pixpop .4s ease-out; }
.pix-result--bad .pix-result__icon { background: #e5383b; box-shadow: 0 0 0 0.5rem rgba(229, 56, 59, .12); }
.pix-result__total { display: grid; gap: 0.125rem; margin: 0.5rem 0; }
.pix-result__total span { font-size: 0.8125rem; color: var(--muted); }
.pix-result__total strong { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: #0a1c4a; }
.pix-result .pix-items { width: 100%; text-align: left; margin-top: 0.5rem; }
@keyframes pixpop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 640px) {
  .pix { padding: 1rem 1rem 0.25rem; }
  .pix-main { grid-template-columns: 1fr; justify-items: center; gap: 1.5rem; text-align: center; }
  .pix-qr { width: min(14rem, 70vw); height: min(14rem, 70vw); }
  .pix-info { justify-items: center; }
  .pix-steps { text-align: left; }
  .pix-copy__row { flex-direction: column; }
  .pix-copy__row .btn { width: 100%; }
  .pix-foot { padding: 0.875rem 1rem; }
  .pix-sim { flex-direction: column; align-items: flex-start; }
}

/* ============ HISTÓRICO DE PAGAMENTOS NO PERFIL ============ */
.profile-pay { margin: 0 1.5rem 1.5rem; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: 0.875rem; background: #fafbfe; }
.profile-pay__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.profile-pay__head h3 { margin: 0; font-size: 1rem; color: #0a1c4a; }
.profile-pay__head small { color: var(--muted); font-size: 0.8125rem; }
.pp-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--line); }
.pp-row:last-child { border-bottom: 0; }
.pp-row__id { font-weight: 700; color: var(--muted); font-size: 0.875rem; }
.pp-row__info { display: grid; gap: 0.0625rem; min-width: 0; }
.pp-row__info b { font-size: 0.9375rem; }
.pp-row__info small { color: var(--muted); font-size: 0.75rem; }
.pp-row .pill { height: 1.625rem; padding: 0 0.75rem; font-size: 0.75rem; font-weight: 600; }
.pp-empty { margin: 0.5rem 0; color: var(--muted); font-size: 0.875rem; }

/* filtros do histórico completo */
.pay-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.625rem; margin-bottom: 0.75rem; }
.pay-tools .search { flex: 1; min-width: 16rem; }
.pay-tools .btn { height: 3rem; }
.pay-count { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 760px) {
  .pay-tools .datefield { flex: 1; }
  .pay-tools .btn { flex: 1; }
}

/* ============ CARTEIRAS ============ */
.wallet-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.125rem; margin-bottom: 1.25rem; }
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1.125rem; }

.wallet-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.125rem; min-width: 0; cursor: pointer; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.wallet-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 36, 80, .12); border-color: #8db3f3; }
.wallet-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wallet-card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.wallet-card__icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #1d5fd1; box-shadow: 0 6px 14px rgba(29, 95, 209, .3); }
.wallet-card__icon svg { width: 1.375rem; height: 1.375rem; }
.wallet-card h3 { margin: 0.375rem 0 0; font-size: 1.125rem; color: #0a1c4a; overflow-wrap: anywhere; }
.wallet-card__sub { margin: 0; font-size: 0.875rem; color: var(--muted); }
.wallet-card__meta { margin: 0.375rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.wallet-card__meta dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.wallet-card__meta dd { margin: 0.125rem 0 0; font-size: 0.875rem; font-weight: 700; white-space: nowrap; }
.wallet-card.is-orphan { border-style: dashed; background: #fafbfe; }

.wallet-badge { display: inline-flex; align-items: center; height: 1.625rem; padding: 0 0.75rem; border-radius: 1rem; background: #e8f0ff; color: #0b3a8c; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.wallet-badge--lg { height: 2rem; padding: 0 1rem; font-size: 0.9375rem; vertical-align: middle; margin-left: 0.5rem; }

.wallet-bar { height: 0.625rem; border-radius: 0.375rem; background: #e6ebf5; overflow: hidden; }
.wallet-bar i { display: block; height: 100%; border-radius: 0.375rem; background: linear-gradient(90deg, #1d5fd1, #4b8bf5); transition: width .4s ease; }
.wallet-bar--lg { height: 0.875rem; border-radius: 0.5rem; }

/* 100% paga = verde */
.wallet-card.is-done { border-color: #12a150; background: linear-gradient(180deg, #f0fbf4, #ffffff 70%); box-shadow: 0 0 0 3px rgba(18, 161, 80, .12), var(--shadow); }
.wallet-card.is-done:hover { border-color: #0d8a43; }
.wallet-card.is-done .wallet-card__icon { background: #12a150; box-shadow: 0 6px 14px rgba(18, 161, 80, .35); }
.wallet-card.is-done .wallet-badge, .wallet-head .wallet-badge--lg { background: #12a150; color: #fff; }
.wallet-card.is-done .wallet-bar { background: #cdeed9; }
.wallet-card.is-done .wallet-bar i, .wallet-hero.is-done .wallet-bar i { background: linear-gradient(90deg, #12a150, #2fc973); }
.wallet-card.is-done h3 { color: #0b5a2c; }

.wallet-back { margin-bottom: 0.75rem; font-size: 0.9375rem; text-decoration: none; }
.wallet-head { align-items: flex-end; }
.wallet-head h1 { font-size: 2.25rem; }
.wallet-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; justify-content: flex-end; }
.wallet-actions .btn { height: 3rem; white-space: nowrap; }
.wallet-move { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.wallet-move .btn { height: 3rem; }

.wallet-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wallet-hero__pct { display: grid; justify-items: center; min-width: 5rem; }
.wallet-hero__pct strong { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; color: #0a1c4a; line-height: 1; }
.wallet-hero__pct span { font-size: 0.8125rem; color: var(--muted); }
.wallet-hero__main { display: grid; gap: 0.875rem; min-width: 0; }
.wallet-hero__stats { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.wallet-hero__stats dt { font-size: 0.75rem; color: var(--muted); }
.wallet-hero__stats dd { margin: 0.125rem 0 0; font-size: 1.0625rem; font-weight: 700; white-space: nowrap; }
.wallet-hero__cta .btn { height: auto; padding: 0.625rem 1.25rem; flex-direction: column; gap: 0.125rem; white-space: nowrap; }
.wallet-hero__cta .btn small { font-weight: 500; opacity: .9; font-size: 0.75rem; }
.wallet-hero__ok { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: #0f7a3f; }
.wallet-hero__ok svg { width: 1.5rem; height: 1.5rem; padding: 0.25rem; border-radius: 50%; background: #12a150; color: #fff; }
.wallet-hero.is-done { border-color: #12a150; background: linear-gradient(135deg, #f0fbf4, #ffffff); box-shadow: 0 0 0 3px rgba(18, 161, 80, .12), var(--shadow); }
.wallet-hero.is-done .wallet-hero__pct strong { color: #0f7a3f; }
.wallet-hero.is-done .wallet-bar { background: #cdeed9; }

.wallet-table .table { min-width: 52rem; }
.wallet-table tr.is-open td:first-child { box-shadow: inset 3px 0 0 #f0a020; }
.wallet-danger { display: flex; justify-content: flex-end; gap: 1.25rem; margin-top: 1rem; }

.wallet-upload { display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 1rem; border: 1.5px dashed #9db9e8; border-radius: 0.75rem; background: #f5f9ff; }
.wallet-upload > svg { width: 2.25rem; height: 2.25rem; color: #12a150; flex: none; }
.wallet-upload > div { flex: 1; min-width: 0; display: grid; gap: 0.125rem; }
.wallet-upload strong { font-size: 0.9375rem; color: var(--ink); }
.wallet-upload span { font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.wallet-upload .btn { flex: none; }

/* loja: carteira no card e filtro */
.shop-card__wallet { margin: 0; display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: #0b3a8c; }
.shop-card__wallet svg { width: 1rem; height: 1rem; }
.shop-toolbar .select { min-width: 12rem; }

@media (max-width: 900px) {
  .wallet-summary { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .wallet-hero { grid-template-columns: auto minmax(0, 1fr); }
  .wallet-hero__cta { grid-column: 1 / -1; }
  .wallet-hero__cta .btn { width: 100%; }
}
@media (max-width: 760px) {
  .wallet-head { align-items: flex-start; }
  .wallet-head h1 { font-size: 1.75rem; }
  .wallet-actions { justify-content: flex-start; width: 100%; }
  .wallet-actions .btn { flex: 1; }
  .wallet-table .table { min-width: 0; }
  .wallet-upload { flex-wrap: wrap; }
  .wallet-upload .btn { width: 100%; }
  .wallet-danger { justify-content: space-between; }
  .shop-toolbar .select { flex: 1 1 100%; }
}

/* ============ MOVER PEDIDO ============ */
.move-body { padding: 1.25rem 1.5rem; display: grid; gap: 1rem; }
.move-body label { display: grid; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.move-body .select { width: 100%; height: 2.875rem; }
.move-info { display: grid; gap: 0.25rem; padding: 0.875rem 1rem; border-radius: 0.75rem; background: #f6f8fc; font-size: 0.875rem; color: var(--muted); }
.move-info strong { font-size: 1rem; color: #0a1c4a; }
.move-info small { font-weight: 500; color: var(--muted); }
.move-info b { color: var(--ink); }
.wallet-table .th-actions, .wallet-table .td-actions { width: auto; padding: 0 1rem !important; text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
  .wallet-table td.td-actions { position: static; grid-column: 1 / -1; text-align: left; padding: 0 !important; }
  .wallet-table td.td-actions .btn { width: 100%; }
}
