:root {
  --font-ui: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6d788d;
  --line: #e4e9f2;
  --blue: #0f4c81;
  --blue-dark: #0b2f55;
  --blue-soft: #e9f3ff;
  --orange: #f58220;
  --orange-2: #ffad5e;
  --orange-soft: #fff1e5;
  --danger: #c0392b;
  --success: #176a32;
  --shadow: 0 18px 50px rgba(15, 76, 129, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(circle at top left, #dff0ff 0, transparent 34%), var(--bg);
}
button, input, textarea, select { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }

.loading-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(11,47,85,.28); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; }
.loading-card { width: min(340px, 100%); background: #fff; border-radius: 24px; padding: 24px; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 10px; text-align: center; }
.loading-card small { color: var(--muted); }
.spinner { width: 46px; height: 46px; border: 4px solid #e8eef7; border-top-color: var(--orange); border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card {
  width: min(520px, 100%);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 3px 0 0; font-size: 29px; line-height: 1.05; letter-spacing: -.8px; }
.login-card p { color: var(--muted); margin: 18px 0 24px; line-height: 1.5; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-row.center { align-items: center; }
.brand-mark {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 950;
  letter-spacing: -1px;
  box-shadow: 0 12px 25px rgba(245,130,32,.28);
  flex: 0 0 auto;
}
.brand-mark.small { width: 46px; height: 46px; border-radius: 16px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand strong { display: block; font-size: 18px; }
.sidebar-brand span { color: rgba(255,255,255,.72); font-size: 12px; letter-spacing: .08em; }
.nav { display: grid; gap: 10px; }
.nav-link {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.84);
  text-align: left;
  padding: 13px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: .2s;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav-icon { width: 34px; height: 34px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.13); flex: 0 0 auto; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.18); transform: translateX(2px); }
.nav-link.active .nav-icon { background: linear-gradient(135deg, var(--orange), var(--orange-2)); box-shadow: 0 8px 20px rgba(245,130,32,.22); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.78); }

.main { padding: 30px; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--orange); text-transform: uppercase; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
h2 { margin: 3px 0 0; font-size: 34px; letter-spacing: -1px; }
.price-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 13px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15,76,129,.07);
  font-weight: 800;
  white-space: nowrap;
}
.price-pill strong { color: var(--blue); }
.subscription-pill.ok { color: var(--success); }
.subscription-pill.warn { color: var(--orange); }
.subscription-pill.locked { color: var(--danger); }

.page { display: none; }
.page.active { display: block; }
.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.dashboard-toolbar { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.visibility-toggle { min-height: 40px; padding: 10px 14px; }
.config-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.metric-card, .panel, .status-card, .lock-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(228,233,242,.92);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.metric-card { padding: 22px; min-height: 150px; }
.metric-card span, .report-summary span, .calc-box span { color: var(--muted); font-size: 14px; display: block; }
.metric-card strong { display: block; margin: 10px 0; font-size: 36px; letter-spacing: -1px; }
.metric-card small { color: var(--muted); }
.metric-card.accent { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #fff; }
.metric-card.accent span, .metric-card.accent small { color: rgba(255,255,255,.84); }
.metric-card.dark { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.metric-card.dark span, .metric-card.dark small { color: rgba(255,255,255,.82); }

.status-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; margin-bottom: 18px; }
.status-card strong { display: block; font-size: 20px; margin: 4px 0; }
.status-card p { margin: 0; color: var(--muted); }
.status-card.blocked { border-color: #ffd4ce; background: #fff7f5; }
.status-card.warning { border-color: #ffdcae; background: #fffaf2; }

.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 22px; }
.margin-top { margin-top: 18px; }
.wide-panel { width: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-header.wrap { align-items: flex-start; flex-wrap: wrap; }
.panel h3, .lock-card h3 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.panel p, .lock-card p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: #eef3f9;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  transition: .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; filter: none !important; }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.btn.outline { background: #fff; border: 1px solid var(--line); }
.btn.ghost { background: rgba(255,255,255,.12); color: inherit; }
.btn.full { width: 100%; }
.big-btn { font-size: 17px; min-height: 52px; }
.small-btn { padding: 8px 11px; border-radius: 11px; font-size: 13px; min-height: 36px; }
.btn.danger { background: #fff0ee; color: var(--danger); }
.dark-text { color: var(--text) !important; }
.pulse-orange {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  box-shadow: 0 0 0 0 rgba(245,130,32,.58);
  animation: pulseOrange 1.45s infinite;
}
@keyframes pulseOrange {
  0% { box-shadow: 0 0 0 0 rgba(245,130,32,.58); transform: scale(1); }
  70% { box-shadow: 0 0 0 12px rgba(245,130,32,0); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 rgba(245,130,32,0); transform: scale(1); }
}

.form-stack, .saida-form { display: grid; gap: 16px; }
.saida-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.saida-form label:nth-child(4), .saida-form .calc-box, .saida-form button { grid-column: 1 / -1; }
label { color: var(--text); font-weight: 850; font-size: 14px; display: grid; gap: 8px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 15px;
  padding: 14px 14px;
  outline: none;
  color: var(--text);
  min-height: 48px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(15,76,129,.09); }
.hint { color: var(--muted); line-height: 1.4; }

.calc-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: linear-gradient(135deg, var(--blue-soft), #fff); border: 1px solid #d7e9fb; border-radius: 20px; padding: 18px; }
.calc-box strong { font-size: 26px; color: var(--blue-dark); margin-top: 4px; display: block; }

.mini-list { display: grid; gap: 10px; }
.mini-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 13px; background: #fff; }
.mini-item strong { display: block; }
.mini-item small { color: var(--muted); }
.badge { background: var(--orange-soft); color: #ad520d; border-radius: 999px; padding: 7px 10px; font-weight: 950; white-space: nowrap; }

.filter-row { display: flex; gap: 10px; align-items: center; }
.filter-row.compact input, .filter-row.compact select { min-width: 170px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 780px; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td strong { color: var(--blue-dark); }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }

.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 20px; }
.report-summary > div { background: var(--blue-soft); border: 1px solid #d9eafa; border-radius: 18px; padding: 18px; }
.report-summary strong { font-size: 28px; display: block; margin-top: 4px; }
h4 { margin: 24px 0 10px; }
.inline-form { display: flex; gap: 10px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 9px 11px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; font-weight: 750; }
.chip button { border: 0; background: #fff0ee; color: var(--danger); border-radius: 999px; cursor: pointer; }

.alert { margin-bottom: 18px; border-radius: 16px; padding: 14px 16px; font-weight: 850; border: 1px solid #d7e9fb; background: var(--blue-soft); color: var(--blue-dark); }
.alert.error { background: #fff0ee; color: var(--danger); border-color: #ffd4ce; }
.alert.success { background: #eaf8ef; color: var(--success); border-color: #c9efd4; }
.security-note { border: 1px solid #ffdcae; background: #fffaf2; border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; }
.security-note small { color: var(--muted); line-height: 1.4; }
.payment-status-mini { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 850; }

.lock-box { margin-bottom: 18px; }
.lock-card { padding: 24px; border-color: #ffd4ce; background: linear-gradient(135deg, #fff7f5, #fff); }
.lock-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 18px; background: var(--orange-soft); margin-bottom: 12px; font-size: 24px; }
.lock-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.payment-box { margin-top: 18px; display: grid; gap: 12px; max-width: 680px; }
.qr-box { width: min(260px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.qr-box img { width: 100%; display: block; border-radius: 12px; }

.modal { position: fixed; inset: 0; background: rgba(11,47,85,.45); padding: 24px; display: grid; place-items: center; z-index: 50; }
.modal-card { width: min(560px, 100%); background: #fff; border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }

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

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-radius: 0 0 24px 24px; padding: 18px; }
  .nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .nav-link { text-align: center; padding: 11px 8px; flex-direction: column; gap: 6px; font-size: 12px; border-radius: 16px; }
  .nav-link:hover, .nav-link.active { transform: none; }
  .nav-icon { width: 32px; height: 32px; border-radius: 12px; }
  .sidebar-footer { margin-top: 0; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .top-actions { justify-content: flex-start; width: 100%; }
}

@media (max-width: 640px) {
  body { background: var(--bg); }
  .login-screen { padding: 14px; align-items: start; padding-top: 24px; }
  .login-card { padding: 22px; border-radius: 24px; }
  .brand-row { align-items: flex-start; }
  .brand-mark { width: 54px; height: 54px; border-radius: 18px; }
  .login-card h1 { font-size: 24px; }
  .main { padding: 16px; }
  h2 { font-size: 28px; }
  .sidebar { gap: 14px; position: sticky; top: 0; z-index: 30; border-radius: 0 0 22px 22px; }
  .sidebar-brand { justify-content: space-between; }
  .nav { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
  .nav-link { flex: 0 0 86px; white-space: nowrap; min-height: 76px; }
  .sidebar-footer { font-size: 13px; }
  .cards-grid, .report-summary, .calc-box, .saida-form { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; padding: 18px; }
  .metric-card strong { font-size: 32px; }
  .panel { padding: 18px; border-radius: 20px; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .status-card { align-items: flex-start; flex-direction: column; }
  .filter-row, .inline-form, .lock-actions { flex-direction: column; align-items: stretch; }
  .filter-row.compact input, .filter-row.compact select { min-width: 100%; }
  .top-actions, .price-pill, .btn { width: 100%; }
  .dashboard-toolbar { justify-content: stretch; }
  .dashboard-toolbar .btn, .config-actions { width: 100%; }
  .mini-item { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; flex-wrap: wrap; }
  input, textarea, select { font-size: 16px; }
  .lock-card { padding: 18px; border-radius: 20px; }
  .modal { padding: 12px; align-items: end; }
  .modal-card { border-radius: 22px 22px 0 0; max-height: 92vh; overflow: auto; }
  .table-wrap { border-radius: 16px; }
  th, td { padding: 12px; }
}


@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, #alertBox, #lockBox, .status-card { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  .page { display: none !important; }
  #page-relatorios { display: block !important; }
  .table-wrap { overflow: visible; border-radius: 0; }
  table { min-width: 0; font-size: 12px; }
  th, td { padding: 7px; }
}

/* Versão mobile/suporte/login simplificada */
.login-card .alert.success { background: #eaf8ef; color: var(--success); border-color: #c9efd4; }
#loginNome[readonly] { background: #f7f9fc; color: var(--blue-dark); font-weight: 900; text-transform: lowercase; }
#loginSenha { letter-spacing: .32em; font-size: 20px; font-weight: 900; text-align: center; }
.support-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1f9d55, #116d39);
  text-decoration: none;
  box-shadow: 0 16px 38px rgba(17, 109, 57, .30);
  font-weight: 950;
}
.support-float span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.17); }
.support-float:hover { transform: translateY(-2px); filter: brightness(1.02); }
.subscription-detail.success { border-color: #c9efd4; background: #f1fff5; }
.subscription-detail.danger { border-color: #ffd4ce; background: #fff7f5; }
.subscription-detail.orange { border-color: #ffdcae; background: #fffaf2; }
.badge.success { background: #dff7e6; color: var(--success); }
.badge.danger { background: #fff0ee; color: var(--danger); }
.badge.orange { background: var(--orange-soft); color: #ad520d; }
.edit-warning { border-color: #ffdcae; background: #fffaf2; }

@media (max-width: 640px) {
  .support-float { right: 14px; bottom: 14px; padding: 12px 14px; }
  .support-float strong { display: none; }
  .support-float span { width: 34px; height: 34px; }
  .login-card p { margin-bottom: 18px; }
  #loginSenha { font-size: 22px; }
  .nav-link { flex-basis: 92px; }
  .main { padding-bottom: 86px; }
}

.qr-placeholder { min-height: 180px; border: 1px dashed var(--line); border-radius: 14px; display: grid; place-items: center; text-align: center; padding: 18px; color: var(--muted); }
.qr-placeholder strong { color: var(--primary); display: block; margin-bottom: 6px; }


/* V28 - Pagamento fixo em tela até confirmação */
body.payment-modal-open { overflow: hidden; }
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 25, 47, .72);
  backdrop-filter: blur(8px);
}
.payment-modal-card {
  width: min(620px, 100%);
  max-height: min(92vh, 780px);
  overflow: auto;
  background: #fff;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 28px 90px rgba(5, 25, 47, .34);
  border: 1px solid rgba(255,255,255,.72);
}
.payment-modal-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.payment-modal-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 24px;
}
.payment-modal-card h3 { margin: 4px 0 8px; font-size: 26px; }
.payment-modal-card p { margin: 0; color: var(--muted); }
.modal-qr {
  width: min(320px, 100%);
  margin: 14px auto 16px;
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 36px rgba(11,47,85,.10);
}
.payment-modal-copy { display: grid; gap: 8px; margin-top: 8px; }
.payment-modal-copy textarea { min-height: 112px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.payment-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.payment-modal-actions .btn { flex: 1 1 180px; }
.payment-modal-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #eef5ff;
  color: var(--blue-dark);
  font-weight: 900;
}
.payment-modal-status.warn { background: #fff7e8; color: #ad520d; }
.payment-modal-status.success { background: #eaf8ef; color: var(--success); }
@media (max-width: 640px) {
  .payment-modal { padding: 0; align-items: end; }
  .payment-modal-card { border-radius: 26px 26px 0 0; max-height: 94vh; padding: 20px; }
  .payment-modal-top { gap: 12px; }
  .payment-modal-icon { width: 48px; height: 48px; }
  .payment-modal-card h3 { font-size: 22px; }
  .modal-qr { width: min(280px, 100%); }
}

/* V32 - pagamento destacado, financeiro e relatório profissional */
.btn.payment-red {
  background: linear-gradient(135deg, #d7261e, #8f1212) !important;
  color: #fff !important;
  border: 0 !important;
  letter-spacing: .04em;
  box-shadow: 0 0 0 0 rgba(215,38,30,.62);
}
.pulse-red {
  animation: pulseRed 1.35s infinite;
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(215,38,30,.62); transform: scale(1); }
  70% { box-shadow: 0 0 0 13px rgba(215,38,30,0); transform: scale(1.018); }
  100% { box-shadow: 0 0 0 0 rgba(215,38,30,0); transform: scale(1); }
}
.plan-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.plan-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 15px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15,76,129,.07);
  transition: .2s;
}
.plan-card:hover { transform: translateY(-2px); border-color: rgba(15,76,129,.28); }
.plan-card strong { display: block; font-size: 16px; color: var(--blue-dark); }
.plan-card span { display: block; margin-top: 6px; font-weight: 950; font-size: 22px; color: var(--danger); }
.plan-card.featured { border-color: #ffdcae; background: #fffaf2; }
.report-cover {
  border: 1px solid #d9eafa;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #f4f9ff, #fff);
}
.report-summary { grid-template-columns: repeat(4, minmax(0,1fr)); }
.report-cover h3 { margin: 6px 0 6px; font-size: 28px; letter-spacing: -.5px; color: var(--blue-dark); }
.report-cover p { margin: 0 0 16px; color: var(--muted); }
.report-meta { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.report-meta > div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.report-meta span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.report-meta strong { display: block; margin-top: 4px; color: var(--blue-dark); }
.finance-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-summary .badge { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; width: fit-content; }
@media (max-width: 800px) {
  .plan-options, .report-meta, .finance-summary { grid-template-columns: 1fr; }
}
@media print {
  .report-cover { border: 1px solid #ddd; margin-bottom: 18px; }
  .report-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* V33 - plano de 6 meses destacado na Home */
.subscription-home {
  align-items: stretch;
}
.subscription-home-text {
  min-width: 0;
  align-self: center;
}
.home-plan-actions {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(220px, 300px);
  gap: 12px;
  align-items: stretch;
  min-width: min(460px, 100%);
}
.home-plan-actions .btn {
  min-height: 70px;
  justify-content: center;
  font-size: 14px;
}
.compact-plan {
  padding: 12px 14px;
  margin: 0;
  min-height: 70px;
  background: linear-gradient(135deg, #fffaf2, #fff) !important;
  border: 1px solid #ffdcae !important;
  position: relative;
  overflow: hidden;
}
.compact-plan::after {
  content: '';
  position: absolute;
  inset: auto -30px -42px auto;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: rgba(244, 139, 46, .12);
}
.compact-plan small {
  display: block;
  font-weight: 950;
  color: #ad520d;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 10px;
  margin-bottom: 3px;
}
.compact-plan strong {
  font-size: 15px;
}
.compact-plan span {
  font-size: 22px;
}
@media (max-width: 900px) {
  .home-plan-actions {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .home-plan-actions .btn,
  .compact-plan {
    width: 100%;
  }
}

/* V40.6 — relatório executivo, legível e preparado para PDF A4 */
.report-brand {
  align-items: flex-start;
}

.report-brand-copy {
  min-width: 0;
  flex: 1;
}

.report-document-stamp {
  flex: 0 0 auto;
  min-width: 190px;
  padding: 11px 13px;
  border: 1px solid #edc9ae;
  border-radius: 12px;
  text-align: right;
  background: rgba(255, 255, 255, .82);
}

.report-document-stamp span,
.report-document-stamp strong {
  display: block;
}

.report-document-stamp span {
  color: #9a5b3f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
}

.report-document-stamp strong {
  margin-top: 4px;
  color: #9a3412;
  font-size: 12px;
}

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

.report-meta > div:nth-child(n) {
  grid-column: auto;
}

.report-origin-note {
  margin: 13px 0 0 !important;
  padding-top: 11px;
  border-top: 1px solid #f0d4bf;
  color: #8a5a43 !important;
  font-size: 11px;
}

.report-summary {
  counter-reset: report-kpi;
}

.report-summary > div {
  position: relative;
  overflow: hidden;
  min-height: 116px;
}

.report-summary > div::after {
  counter-increment: report-kpi;
  content: "0" counter(report-kpi);
  position: absolute;
  top: 11px;
  right: 13px;
  color: rgba(194, 65, 12, .2);
  font-size: 11px;
  font-weight: 700;
}

.report-summary small {
  display: block;
  margin-top: 4px;
  color: #9a6c56;
  font-size: 11px;
}

.report-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #f0d4bf;
}

.report-section-title > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.report-section-title > div > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  font-size: 11px;
  font-weight: 700;
}

.report-section-title h4 {
  margin: 0;
  color: #431407;
  font-size: 17px;
}

.report-section-title > small {
  max-width: 390px;
  color: #8a6a5b;
  text-align: right;
}

.report-table {
  border-radius: 13px;
  box-shadow: none;
}

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

.report-table th {
  color: #713015;
  background: #fff1e6;
}

.report-table tbody tr:nth-child(even) {
  background: #fffbf7;
}

.report-table td,
.report-table th {
  border-bottom-color: #f2e1d5;
}

.report-table tfoot td {
  color: #6b2b13;
  background: #fff3e8;
  border-top: 1px solid #edc9ae;
  border-bottom: 0;
  font-weight: 700;
}

.report-proof-code {
  display: block;
  margin-top: 3px;
  color: #9a6a55;
  font-size: 9px;
  line-height: 1.2;
}

.report-footer-print {
  break-inside: avoid;
}

@media (max-width: 900px) {
  .report-brand {
    flex-wrap: wrap;
  }

  .report-document-stamp {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

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

  .report-meta > div:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .report-meta {
    grid-template-columns: 1fr;
  }

  .report-meta > div:nth-child(n) {
    grid-column: auto;
  }

  .report-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-section-title > small {
    text-align: left;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    font-size: 10px !important;
  }

  #relatorioPrintArea {
    width: 100% !important;
    padding: 0 !important;
    color: #2f1d16 !important;
  }

  .report-cover {
    margin-bottom: 10px !important;
    padding: 13px !important;
    border-radius: 9px !important;
    break-inside: avoid;
  }

  .report-brand {
    gap: 11px !important;
    margin-bottom: 10px !important;
  }

  .report-logo-wrap {
    width: 68px !important;
    height: 54px !important;
    padding: 5px !important;
    border-radius: 8px !important;
  }

  .report-cover h3 {
    margin: 3px 0 !important;
    font-size: 18px !important;
  }

  .report-cover p {
    margin: 0 !important;
    font-size: 9px !important;
  }

  .report-document-stamp {
    min-width: 155px !important;
    padding: 7px 9px !important;
    border-radius: 7px !important;
  }

  .report-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .report-meta > div:nth-child(n) {
    grid-column: auto !important;
  }

  .report-meta > div {
    padding: 7px !important;
    border-radius: 7px !important;
  }

  .report-meta span {
    font-size: 8px !important;
  }

  .report-meta strong {
    font-size: 9px !important;
  }

  .report-origin-note {
    margin-top: 7px !important;
    padding-top: 6px !important;
    font-size: 8px !important;
  }

  .report-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 8px 0 10px !important;
    break-inside: avoid;
  }

  .report-summary > div {
    min-height: 67px !important;
    padding: 9px !important;
    border-radius: 8px !important;
  }

  .report-summary span,
  .report-summary small {
    font-size: 8px !important;
  }

  .report-summary strong {
    margin-top: 2px !important;
    font-size: 17px !important;
  }

  .report-section-title {
    margin: 10px 0 5px !important;
    padding-bottom: 5px !important;
    break-after: avoid;
  }

  .report-section-title > div > span {
    width: 20px !important;
    height: 20px !important;
    border-radius: 5px !important;
    font-size: 8px !important;
  }

  .report-section-title h4 {
    font-size: 12px !important;
  }

  .report-section-title > small {
    font-size: 8px !important;
  }

  .report-table {
    overflow: visible !important;
    border-radius: 6px !important;
  }

  .report-table table {
    width: 100% !important;
    font-size: 8px !important;
  }

  .report-table thead {
    display: table-header-group;
  }

  .report-table tfoot {
    display: table-row-group;
  }

  .report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-table th,
  .report-table td {
    padding: 5px 6px !important;
    font-size: 8px !important;
    line-height: 1.25 !important;
  }

  .delivery-badge {
    padding: 3px 5px !important;
    font-size: 7px !important;
  }

  .report-proof-code {
    font-size: 7px !important;
  }

  .report-footer-print {
    grid-template-columns: minmax(210px, 1.4fr) repeat(2, minmax(135px, 1fr)) !important;
    margin-top: 13px !important;
    padding: 11px !important;
    gap: 15px !important;
    font-size: 8px !important;
    break-inside: avoid;
  }

  .report-signature {
    padding-top: 20px !important;
  }
}

/* V34 - paleta Sabor e Conforto + planos e financeiro premium */
:root {
  --bg: #FFFDF9;
  --panel: #FFFFFF;
  --text: #1D3557;
  --muted: #647084;
  --line: #F0E6DA;
  --blue: #1D3557;
  --blue-dark: #14263F;
  --blue-soft: #F3F7FB;
  --orange: #E9C46A;
  --orange-2: #F2D27D;
  --orange-soft: #FFF7DF;
  --danger: #E63946;
  --success: #1F8A4C;
  --shadow: 0 18px 50px rgba(29, 53, 87, .10);
}
body {
  background: radial-gradient(circle at top left, rgba(233,196,106,.20) 0, transparent 34%), var(--bg);
}
.brand-mark, .nav-link.active .nav-icon {
  background: linear-gradient(135deg, var(--danger), #B71F2D);
  box-shadow: 0 12px 25px rgba(230,57,70,.20);
}
.sidebar {
  background: linear-gradient(180deg, var(--blue-dark), var(--blue));
}
.nav-icon {
  font-weight: 950;
  font-size: 16px;
  color: #fff;
}
.metric-card.accent {
  background: linear-gradient(135deg, var(--danger), #B71F2D);
}
.metric-card.dark {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}
.btn.primary {
  background: linear-gradient(135deg, var(--danger), #B71F2D);
}
.btn.payment-red {
  background: linear-gradient(135deg, #E63946, #B91E2B) !important;
  color: #fff !important;
  border: 0 !important;
  letter-spacing: .035em;
  box-shadow: 0 0 0 0 rgba(230,57,70,.62);
}
.pulse-red { animation: pulseRedV34 1.35s infinite; }
@keyframes pulseRedV34 {
  0% { box-shadow: 0 0 0 0 rgba(230,57,70,.64); transform: scale(1); }
  70% { box-shadow: 0 0 0 13px rgba(230,57,70,0); transform: scale(1.018); }
  100% { box-shadow: 0 0 0 0 rgba(230,57,70,0); transform: scale(1); }
}
.dashboard-toolbar { display: none !important; }
.premium-plans {
  padding: 22px;
  border: 1px solid rgba(233,196,106,.45);
  background: linear-gradient(135deg, #fff, #fffaf0);
}
.home-plan-actions {
  grid-template-columns: minmax(210px, 1fr) minmax(240px, 1fr);
  min-width: min(560px, 100%);
}
.plan-monthly-btn, .config-plan-card {
  min-height: 88px;
  border-radius: 22px;
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
  padding: 15px 18px;
}
.plan-monthly-btn small, .config-plan-card small {
  display: block;
  color: rgba(255,255,255,.88);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 10px;
}
.plan-monthly-btn strong, .config-plan-card strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
}
.plan-monthly-btn span, .config-plan-card span {
  color: #fff;
  font-size: 23px;
  font-weight: 950;
}
.compact-plan {
  min-height: 88px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff9e6, #fff) !important;
  border: 1px solid rgba(233,196,106,.75) !important;
  box-shadow: 0 14px 32px rgba(29,53,87,.08);
}
.compact-plan small { color: #9A6A00; }
.compact-plan strong { color: var(--blue-dark); }
.compact-plan span { color: var(--danger); }
.config-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.config-plan-card {
  border: 0;
  cursor: pointer;
  transition: .2s;
  box-shadow: 0 14px 34px rgba(29,53,87,.10);
}
.config-plan-card:hover { transform: translateY(-2px); }
.config-plan-card.semestral {
  background: linear-gradient(135deg, #FFF5D6, #FFFFFF);
  border: 1px solid rgba(233,196,106,.70);
}
.config-plan-card.semestral small { color: #9A6A00; }
.config-plan-card.semestral strong { color: var(--blue-dark); }
.config-plan-card.semestral span { color: var(--danger); }
.price-pill.subscription-pill { display: none; }
.finance-chart-card {
  background: linear-gradient(135deg, #fff, #fffaf0);
  border: 1px solid rgba(233,196,106,.42);
  border-radius: 24px;
  padding: 20px;
  margin: 8px 0 18px;
  box-shadow: 0 14px 34px rgba(29,53,87,.07);
}
.finance-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.finance-chart-header h4 { margin: 4px 0 0; font-size: 22px; }
.finance-chart-header > strong {
  color: var(--danger);
  font-size: 24px;
  white-space: nowrap;
}
.finance-bars { display: grid; gap: 13px; }
.finance-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr minmax(105px, auto);
  gap: 12px;
  align-items: center;
}
.finance-bar-label strong { display: block; color: var(--blue-dark); }
.finance-bar-label span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.finance-bar-track {
  height: 14px;
  background: #F5EADB;
  border-radius: 999px;
  overflow: hidden;
}
.finance-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--danger), var(--orange));
}
.finance-bar-value { color: var(--blue-dark); text-align: right; }
@media (max-width: 900px) {
  .home-plan-actions, .config-plan-grid { grid-template-columns: 1fr; }
  .finance-bar-row { grid-template-columns: 1fr; gap: 7px; }
  .finance-bar-value { text-align: left; }
}
@media print {
  #supportFloat, .support-float, .payment-modal, .loading-overlay { display: none !important; }
  .report-cover, .print-area, #relatorioPrintArea { box-shadow: none !important; }
}


/* V35 - ajustes visuais, impressão e financeiro consolidado */
:root {
  --orange: #F97316;
  --orange-2: #FF8A1F;
  --orange-soft: #FFF1E6;
  --warning: #F97316;
}

/* Pagamentos mais discretos e profissionais no dashboard */
.subscription-home.premium-plans {
  padding: 18px 20px;
  gap: 18px;
  align-items: center;
  border-color: rgba(249,115,22,.28);
  background: linear-gradient(135deg, #fff, #fff7ef);
}
.subscription-home-text .eyebrow { color: var(--orange); }
.home-plan-actions {
  align-items: stretch;
  grid-template-columns: minmax(190px, 240px) minmax(210px, 260px);
}
.plan-monthly-btn, .config-plan-card {
  min-height: 72px;
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 10px 22px rgba(29,53,87,.08);
}
.plan-monthly-btn small, .config-plan-card small {
  font-size: 9px;
  letter-spacing: .08em;
}
.plan-monthly-btn strong, .config-plan-card strong { font-size: 14px; }
.plan-monthly-btn span, .config-plan-card span { font-size: 21px; }
.btn.payment-red {
  background: linear-gradient(135deg, #E63946, #C92534) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px rgba(230,57,70,.20);
}
.pulse-red { animation: pulseRedV35 1.55s infinite; }
@keyframes pulseRedV35 {
  0% { box-shadow: 0 0 0 0 rgba(230,57,70,.44); transform: scale(1); }
  70% { box-shadow: 0 0 0 8px rgba(230,57,70,0); transform: scale(1.006); }
  100% { box-shadow: 0 0 0 0 rgba(230,57,70,0); transform: scale(1); }
}
.compact-plan {
  min-height: 72px;
  background: linear-gradient(135deg, #fff7ec, #fff) !important;
  border: 1px solid rgba(249,115,22,.36) !important;
  box-shadow: 0 10px 22px rgba(29,53,87,.07);
}
.compact-plan small, .config-plan-card.semestral small { color: #B45309; }
.compact-plan span, .config-plan-card.semestral span { color: var(--danger); }

/* Corrige plano mensal invisível quando o sistema está pago/desativado */
.config-plan-card.monthly {
  background: linear-gradient(135deg, #E63946, #C92534);
  color: #fff;
}
.config-plan-card.monthly:not(.payment-red) {
  background: linear-gradient(135deg, #FFF7F7, #FFFFFF);
  border: 1px solid rgba(230,57,70,.25);
  color: var(--text);
}
.config-plan-card.monthly:not(.payment-red) small,
.config-plan-card.monthly:not(.payment-red) strong { color: var(--blue-dark); }
.config-plan-card.monthly:not(.payment-red) span { color: var(--danger); }
.config-plan-card:disabled { opacity: .78; }

/* Se a assinatura estiver em dia, as opções de pagamento somem do dashboard/configurações */
.paid-hidden { display: none !important; }

/* Modal de edição com rolagem garantida no desktop e mobile */
.modal {
  overflow-y: auto;
  place-items: start center;
  align-items: start;
}
.modal-card {
  margin: 28px 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 800px) {
  .modal { align-items: end; place-items: end center; }
  .modal-card { margin: 0; max-height: 94vh; }
}

/* Financeiro estilo painel bancário: visão consolidada, não por secretaria */
.finance-chart-card {
  background: linear-gradient(135deg, #FFFFFF, #FFF7EF);
  border-color: rgba(249,115,22,.28);
}
.finance-chart-header .eyebrow { color: var(--orange); }
.finance-bank-hero {
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, #1D3557, #0F223A);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: 0 18px 42px rgba(29,53,87,.16);
}
.finance-bank-hero span { display: block; opacity: .82; font-weight: 800; }
.finance-bank-hero strong { display: block; font-size: clamp(30px, 4vw, 46px); margin: 8px 0 6px; color: #fff; }
.finance-bank-hero small { opacity: .82; }
.finance-bank-badge {
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  white-space: nowrap;
}
.finance-kpi-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.finance-kpi {
  background: #fff;
  border: 1px solid rgba(249,115,22,.18);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(29,53,87,.06);
}
.finance-kpi span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.finance-kpi strong { display: block; color: var(--blue-dark); font-size: 22px; margin: 8px 0 12px; }
.finance-progress { height: 9px; border-radius: 999px; overflow: hidden; background: #FFE4D1; }
.finance-progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--danger), var(--orange)); }
@media (max-width: 900px) {
  .home-plan-actions, .config-plan-grid, .finance-kpi-grid { grid-template-columns: 1fr; }
  .finance-bank-hero { display: grid; }
  .finance-bank-badge { width: fit-content; }
}

/* Impressão/PDF: remove suporte, menus, overlays e deixa só o relatório */
body.printing-report #supportFloat,
body.printing-report .support-float,
body.printing-report .sidebar,
body.printing-report .topbar,
body.printing-report #alertBox,
body.printing-report .loading-overlay,
body.printing-report .payment-modal,
body.printing-report .no-print { display: none !important; }
body.printing-report .main { padding: 0 !important; margin: 0 !important; }
@media print {
  #supportFloat, .support-float, .sidebar, .topbar, #alertBox, .loading-overlay, .payment-modal, .no-print { display: none !important; }
  body { background: #fff !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; margin: 0 !important; }
  #page-relatorios { display: block !important; }
  .page:not(#page-relatorios) { display: none !important; }
  #relatorioPrintArea { border: 0 !important; box-shadow: none !important; }
}


.dashboard-toolbar { display:flex; justify-content:flex-end; margin: 0 0 14px; }
.visibility-toggle { min-height: 42px; padding: 10px 14px; border-radius: 999px; font-weight: 800; }
.visibility-toggle .toggle-icon { width: 20px; height: 20px; display:grid; place-items:center; font-size: 12px; border-radius: 999px; background: #fff7f0; color: var(--orange); }
.visibility-toggle.is-hidden-mode .toggle-icon { background: #eef3f9; color: var(--blue); }

.finance-overview-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.finance-overview-card { background:#fff; border:1px solid var(--line); border-radius:20px; padding:18px; box-shadow: 0 10px 24px rgba(29,53,87,.06); }
.finance-overview-card.highlight { background: linear-gradient(135deg, rgba(230,57,70,.08), rgba(233,196,106,.18)); border-color: rgba(230,57,70,.15); }
.finance-overview-card span { display:block; color: var(--muted); font-size: 13px; }
.finance-overview-card strong { display:block; margin-top:6px; font-size: 28px; color: var(--text); }
.finance-overview-card small { display:block; margin-top:6px; color: var(--muted); }
.finance-columns-wrap { position: relative; padding-top: 8px; }
.finance-columns-axis { position:absolute; left:0; right:0; bottom: 44px; border-bottom:1px solid rgba(29,53,87,.12); }
.finance-columns { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; align-items:end; min-height: 270px; }
.finance-col-item { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; text-align:center; gap:8px; }
.finance-col-value { font-size: 12px; color: var(--text); font-weight: 800; }
.finance-col-bar { width: min(64px, 100%); border-radius: 18px 18px 8px 8px; background: linear-gradient(180deg, #E9C46A 0%, #F77F00 45%, #E63946 100%); box-shadow: 0 14px 25px rgba(230,57,70,.22); }
.finance-col-item strong { font-size: 13px; color: var(--text); line-height: 1.25; }
.finance-col-item small { font-size: 12px; color: var(--muted); }

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


/* V37 - ocultar valores, gráfico por secretaria e relatório com CNPJ */
.dashboard-toolbar { display:flex; justify-content:flex-end; margin: 0 0 14px; }
.visibility-toggle { min-height: 42px; padding: 10px 14px; border-radius: 999px; font-weight: 850; }
.visibility-toggle .toggle-icon { width: 20px; height: 20px; display:grid; place-items:center; font-size: 12px; border-radius: 999px; background: #FFF1E6; color: var(--orange); }
.visibility-toggle.is-hidden-mode .toggle-icon { background: #EEF3F9; color: var(--blue); }
.finance-overview-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.finance-overview-card { background:#fff; border:1px solid var(--line); border-radius:20px; padding:18px; box-shadow: 0 10px 24px rgba(29,53,87,.06); }
.finance-overview-card.highlight { background: linear-gradient(135deg, rgba(230,57,70,.08), rgba(249,115,22,.14)); border-color: rgba(249,115,22,.22); }
.finance-overview-card span { display:block; color: var(--muted); font-size: 13px; }
.finance-overview-card strong { display:block; margin-top:6px; font-size: 28px; color: var(--text); }
.finance-overview-card small { display:block; margin-top:6px; color: var(--muted); }
.finance-columns-wrap { position: relative; padding-top: 8px; }
.finance-columns-axis { position:absolute; left:0; right:0; bottom: 44px; border-bottom:1px solid rgba(29,53,87,.12); }
.finance-columns { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; align-items:end; min-height: 270px; }
.finance-col-item { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; text-align:center; gap:8px; }
.finance-col-value { font-size: 12px; color: var(--text); font-weight: 850; }
.finance-col-bar { width: min(64px, 100%); border-radius: 18px 18px 8px 8px; background: linear-gradient(180deg, #F97316 0%, #EF4444 100%); box-shadow: 0 14px 25px rgba(230,57,70,.22); }
.finance-col-item strong { font-size: 13px; color: var(--text); line-height: 1.25; }
.finance-col-item small { font-size: 12px; color: var(--muted); }
.report-footer-print { margin-top: 24px; padding-top: 14px; border-top: 1px solid #ddd; display:flex; justify-content:space-between; gap: 16px; color: var(--text); font-size: 12px; }
@media (max-width: 900px) {
  .finance-overview-grid { grid-template-columns: 1fr; }
  .finance-columns { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media print {
  @page { margin: 12mm; }
  .report-footer-print { display:flex !important; }
}


/* V38 - planos da home mais finos e discretos */
.subscription-home.premium-plans {
  padding: 14px 18px;
  gap: 14px;
}
.subscription-home-text {
  gap: 6px;
}
.subscription-home-text strong#subscriptionTitle {
  font-size: 18px;
}
.subscription-home-text p {
  font-size: 13px;
  line-height: 1.45;
}
.home-plan-actions {
  grid-template-columns: minmax(175px, 215px) minmax(185px, 225px);
  gap: 10px;
  align-items: center;
}
.plan-monthly-btn,
.compact-plan {
  min-height: 58px !important;
  border-radius: 16px !important;
  padding: 9px 14px !important;
  box-shadow: 0 7px 16px rgba(29,53,87,.06) !important;
}
.plan-monthly-btn small,
.compact-plan small {
  font-size: 8px !important;
  line-height: 1.1;
  letter-spacing: .07em;
}
.plan-monthly-btn strong,
.compact-plan strong {
  font-size: 12px !important;
  line-height: 1.15;
  font-weight: 800;
}
.plan-monthly-btn span,
.compact-plan span {
  font-size: 17px !important;
  line-height: 1;
  font-weight: 900;
}
.btn.payment-red {
  box-shadow: 0 6px 14px rgba(230,57,70,.14) !important;
}
.pulse-red {
  animation: pulseRedV38 1.8s infinite;
}
@keyframes pulseRedV38 {
  0% { box-shadow: 0 0 0 0 rgba(230,57,70,.20); }
  70% { box-shadow: 0 0 0 5px rgba(230,57,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,57,70,0); }
}
@media (max-width: 1100px) {
  .home-plan-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .subscription-home.premium-plans { padding: 14px; }
  .home-plan-actions { grid-template-columns: 1fr; gap: 8px; }
  .plan-monthly-btn,
  .compact-plan { min-height: 56px !important; }
}


/* V39 - reajuste de alinhamento dos planos na Home */
.subscription-home.premium-plans {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 520px) !important;
  align-items: center !important;
  column-gap: 22px !important;
  row-gap: 14px !important;
  padding: 18px 22px !important;
  min-height: 118px !important;
}

.subscription-home.premium-plans .subscription-home-text {
  min-width: 0 !important;
  max-width: 100% !important;
}

.subscription-home.premium-plans .subscription-home-text p {
  max-width: 680px !important;
  margin-top: 6px !important;
}

.subscription-home.premium-plans .home-plan-actions {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
  justify-self: end !important;
}

.subscription-home.premium-plans .plan-monthly-btn,
.subscription-home.premium-plans .compact-plan {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 76px !important;
  height: 76px !important;
  padding: 12px 16px !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
  display: grid !important;
  align-content: center !important;
  justify-items: start !important;
  text-align: left !important;
  overflow: hidden !important;
}

.subscription-home.premium-plans .plan-monthly-btn small,
.subscription-home.premium-plans .compact-plan small {
  font-size: 9px !important;
  letter-spacing: .07em !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.subscription-home.premium-plans .plan-monthly-btn strong,
.subscription-home.premium-plans .compact-plan strong {
  font-size: 13px !important;
  line-height: 1.2 !important;
  margin: 2px 0 4px !important;
  white-space: normal !important;
}

.subscription-home.premium-plans .plan-monthly-btn span,
.subscription-home.premium-plans .compact-plan span {
  font-size: 18px !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.subscription-home.premium-plans .compact-plan::before,
.subscription-home.premium-plans .compact-plan::after,
.subscription-home.premium-plans .plan-card::before,
.subscription-home.premium-plans .plan-card::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 1250px) {
  .subscription-home.premium-plans {
    grid-template-columns: 1fr !important;
  }
  .subscription-home.premium-plans .home-plan-actions {
    justify-self: stretch !important;
    max-width: 560px !important;
  }
}

@media (max-width: 720px) {
  .subscription-home.premium-plans {
    padding: 16px !important;
  }
  .subscription-home.premium-plans .home-plan-actions {
    grid-template-columns: 1fr !important;
    max-width: none !important;
  }
  .subscription-home.premium-plans .plan-monthly-btn,
  .subscription-home.premium-plans .compact-plan {
    height: auto !important;
    min-height: 66px !important;
  }
}

/* V40 Premium — operação, comprovação e contas a receber */
:root {
  --bg: #f5f2ec;
  --panel: #ffffff;
  --text: #172334;
  --muted: #6e7886;
  --line: #e7e1d7;
  --blue: #18283b;
  --blue-dark: #0d1928;
  --blue-soft: #edf2f6;
  --orange: #c59445;
  --orange-2: #e1bd78;
  --orange-soft: #fbf3e4;
  --danger: #b63c43;
  --success: #2e7d5b;
  --shadow: 0 22px 60px rgba(13, 25, 40, .09);
  --shadow-soft: 0 10px 28px rgba(13, 25, 40, .065);
  --radius: 22px;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(197, 148, 69, .18), transparent 28%),
    linear-gradient(180deg, #faf8f4 0%, var(--bg) 100%);
}

.loading-overlay { background: rgba(13, 25, 40, .42); }
.spinner { border-top-color: var(--orange); }

.login-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(13,25,40,.97), rgba(24,40,59,.91)),
    radial-gradient(circle at 80% 20%, rgba(197,148,69,.3), transparent 30%);
}
.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.login-screen::before {
  width: 440px;
  height: 440px;
  right: -150px;
  top: -170px;
  border: 1px solid rgba(225,189,120,.2);
  box-shadow: 0 0 0 70px rgba(225,189,120,.035), 0 0 0 140px rgba(225,189,120,.025);
}
.login-screen::after {
  width: 250px;
  height: 250px;
  left: -90px;
  bottom: -110px;
  background: rgba(182,60,67,.12);
  filter: blur(8px);
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  padding: 38px;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 35px 90px rgba(0,0,0,.28);
}
.brand-mark,
.nav-link.active .nav-icon {
  background: linear-gradient(145deg, #d9ae64, #a9772f);
  box-shadow: 0 12px 26px rgba(197,148,69,.24);
}
.login-card .brand-mark { color: #172334; }

.app { grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  padding: 26px 20px;
  background:
    radial-gradient(circle at 30% 0%, rgba(197,148,69,.14), transparent 28%),
    linear-gradient(180deg, #101e2f, #0b1624);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand { padding: 0 6px 8px; }
.sidebar-brand span { font-size: 10px; letter-spacing: .13em; }
.nav { gap: 7px; }
.nav-link {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.68);
  padding: 10px 11px;
  border-radius: 14px;
  font-size: 13px;
}
.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  font-size: 12px;
}
.nav-link:hover { background: rgba(255,255,255,.07); }
.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(197,148,69,.2), rgba(255,255,255,.05));
  box-shadow: inset 3px 0 0 #d6ac63;
  transform: none;
}
.nav-link.active .nav-icon { color: #132033; }
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 18px;
  font-size: 13px;
}

.main { padding: 32px clamp(22px, 3vw, 46px) 46px; }
.topbar { margin-bottom: 26px; }
.topbar h2 { color: var(--blue-dark); font-size: clamp(28px, 3vw, 38px); }
.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  padding: 12px 15px;
  box-shadow: var(--shadow-soft);
  max-width: 240px;
}
.profile-pill strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.profile-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(46,125,91,.11); }
.price-pill { box-shadow: var(--shadow-soft); background: rgba(255,255,255,.86); }
.price-pill strong { color: var(--blue-dark); }

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr);
  gap: 28px;
  align-items: center;
  min-height: 270px;
  margin-bottom: 18px;
  padding: clamp(28px, 4vw, 46px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(225,189,120,.2), transparent 30%),
    linear-gradient(135deg, #0e1a29, #20354d);
  box-shadow: 0 28px 65px rgba(13,25,40,.2);
}
.dashboard-hero::after {
  content: '';
  position: absolute;
  width: 290px;
  height: 290px;
  right: -130px;
  bottom: -170px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 54px rgba(255,255,255,.025), 0 0 0 108px rgba(255,255,255,.018);
}
.dashboard-hero-copy, .hero-receivable-card { position: relative; z-index: 1; }
.hero-kicker { color: #e5c78d; text-transform: uppercase; font-weight: 900; font-size: 11px; letter-spacing: .13em; }
.dashboard-hero h3 {
  max-width: 780px;
  margin: 13px 0 12px;
  font-size: clamp(28px, 3.3vw, 45px);
  line-height: 1.04;
  letter-spacing: -1.5px;
}
.dashboard-hero p { max-width: 660px; color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; margin-top: 23px; flex-wrap: wrap; }
.btn.premium-light { background: linear-gradient(135deg, #e3c480, #bd8d3d); color: #152337; }
.btn.premium-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.16); }
.hero-receivable-card {
  padding: 23px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 23px;
  background: rgba(255,255,255,.085);
  backdrop-filter: blur(8px);
}
.hero-receivable-card > span { color: rgba(255,255,255,.68); font-size: 12px; text-transform: uppercase; letter-spacing: .09em; font-weight: 850; }
.hero-receivable-card > strong { display: block; margin: 9px 0 18px; font-size: clamp(31px, 4vw, 44px); letter-spacing: -1.2px; }
.hero-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-status-row small { color: rgba(255,255,255,.68); text-align: right; }

.cards-grid { gap: 13px; }
.metric-card, .panel, .status-card, .lock-card, .delivery-progress-panel {
  border-color: rgba(221,214,204,.8);
  box-shadow: var(--shadow-soft);
}
.metric-card { min-height: 135px; padding: 20px; border-radius: 20px; }
.metric-card strong { font-size: 31px; }
.metric-card.accent {
  color: var(--text);
  background: linear-gradient(145deg, #f4e2bd, #dfb869);
}
.metric-card.accent span, .metric-card.accent small { color: rgba(23,35,52,.7); }
.metric-card.dark { background: linear-gradient(145deg, #233b55, #101d2c); }
.panel { border-radius: 24px; }
.panel h3 { color: var(--blue-dark); }

.delivery-progress-panel {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) 1.45fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
}
.delivery-progress-panel h3 { margin: 6px 0 0; }
.delivery-progress-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.delivery-progress-grid > div {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px;
  background: #fbfaf8;
}
.delivery-progress-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.delivery-progress-grid strong { display: block; margin-top: 7px; font-size: 25px; color: var(--blue-dark); }
.delivery-progress-grid .success { background: rgba(46,125,91,.08); border-color: rgba(46,125,91,.18); }
.delivery-progress-grid .success strong { color: var(--success); }

.btn { border-radius: 13px; }
.btn.primary { background: linear-gradient(135deg, #233a54, #0e1b2a); }
.btn.proof-btn { background: var(--orange-soft); color: #8a5d18; border: 1px solid rgba(197,148,69,.28); }
.pulse-orange { background: linear-gradient(135deg, #d0a355, #a9772f); color: #142033; animation: none; }
.eyebrow { color: #a67529; }
.badge.success { background: #e8f4ed; color: var(--success); }
.table-subline { display: block; color: var(--muted); margin-top: 6px; max-width: 190px; line-height: 1.35; }
.delivery-badge, .status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  background: #eef1f4;
  color: #506072;
}
.delivery-badge.registrada { background: #edf1f5; color: #526273; }
.delivery-badge.em_preparo { background: #fff2dd; color: #9a6418; }
.delivery-badge.saiu_entrega { background: #e8f0fb; color: #35608b; }
.delivery-badge.entregue { background: #e7f4ed; color: var(--success); }
.status-chip.em_aberto { background: #f0f1f3; color: #536171; }
.status-chip.relatorio_enviado { background: #e9f1fb; color: #365f89; }
.status-chip.nota_emitida { background: #fbf0dc; color: #96631c; }
.status-chip.aguardando_pagamento { background: #fff1e4; color: #a85d20; }
.status-chip.pago { background: #e5f3eb; color: var(--success); }
.status-chip.atrasado { background: #fae8e9; color: var(--danger); }

.report-cover {
  background: linear-gradient(135deg, #f8f5ef, #fff);
  border-color: var(--line);
}
.report-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.report-logo-wrap { width: 94px; height: 76px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 8px; flex: 0 0 auto; }
.report-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.report-meta { grid-template-columns: repeat(4, minmax(0,1fr)); }
.report-footer-print { align-items: flex-end; }
.report-footer-print > div:first-child { display: grid; gap: 5px; }
.report-signature { min-width: 170px; padding-top: 28px; border-top: 1px solid #6f7680; text-align: center; }

.receivable-workspace {
  display: grid;
  grid-template-columns: minmax(230px, .55fr) minmax(0, 1.45fr);
  gap: 16px;
  margin: 18px 0;
}
.receivable-timeline,
.receivable-form {
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 20px;
  background: #fbfaf7;
}
.receivable-form { background: #fff; }
.status-steps { display: grid; gap: 8px; margin-top: 17px; }
.status-step { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; color: #9a9fa7; }
.status-step span {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: #ece9e3; font-weight: 900; font-size: 12px;
}
.status-step strong { font-size: 13px; }
.status-step.done { color: var(--blue-dark); }
.status-step.done span { background: #e7d2a5; color: #684719; }
.status-step.current span { background: var(--blue-dark); color: #fff; box-shadow: 0 0 0 5px rgba(23,35,52,.08); }
.form-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.form-section-title h4 { margin: 0 0 4px; }
.form-section-title p { margin: 0; color: var(--muted); font-size: 13px; }
.form-grid-2, .form-grid-3 { display: grid; gap: 13px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.plan-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 17px;
  padding: 24px 26px;
  border-radius: 25px;
  color: #fff;
  background: linear-gradient(135deg, #101e2f, #263e58);
  box-shadow: 0 20px 45px rgba(13,25,40,.16);
}
.plan-page-hero h3 { margin: 6px 0; font-size: 28px; }
.plan-page-hero p { margin: 0; color: rgba(255,255,255,.68); }
.secure-label { border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.08); padding: 10px 13px; border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 850; }
.subscription-home.premium-plans {
  grid-template-columns: minmax(0, 1fr) minmax(460px, 520px) !important;
  padding: 21px 23px !important;
  background: linear-gradient(135deg, #fff, #fbf4e8);
  border-color: rgba(197,148,69,.3);
}
.subscription-home.premium-plans .plan-monthly-btn,
.subscription-home.premium-plans .compact-plan { min-height: 78px !important; height: 78px !important; }
.btn.payment-red { background: linear-gradient(135deg, #b63c43, #8f2830) !important; }

.audit-list { display: grid; gap: 2px; }
.audit-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--orange-soft); color: #8c611e; font-weight: 950; }
.audit-item strong, .audit-item small { display: block; }
.audit-item small { color: var(--muted); margin-top: 3px; }
.audit-item p { margin: 6px 0 0; font-size: 13px; color: #4f5d6d; }

.signature-box { border: 1px solid var(--line); border-radius: 19px; padding: 14px; background: #f9f8f5; }
.signature-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.signature-head strong, .signature-head small { display: block; }
.signature-head small { color: var(--muted); margin-top: 3px; }
#signatureCanvas { display: block; width: 100%; height: 190px; border: 1px dashed #b7b0a5; border-radius: 13px; background: #fff; touch-action: none; cursor: crosshair; }
.proof-photo-preview { border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: #fff; }
.proof-photo-preview img { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 11px; }
.proof-photo-preview .btn { margin-top: 9px; }
.receipt-code { padding: 11px 13px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-weight: 850; font-size: 12px; }
.logo-preview { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; padding: 10px; background: #faf9f6; }
.logo-preview img { width: 78px; height: 54px; object-fit: contain; border-radius: 9px; background: #fff; }
.logo-preview strong, .logo-preview small { display: block; }
.logo-preview small { color: var(--muted); margin-top: 3px; }
.logo-preview > .btn { margin-left: auto; }
.config-help-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #fff, #fbf4e7); }

@media (max-width: 1180px) {
  .dashboard-hero { grid-template-columns: 1fr; }
  .delivery-progress-panel { grid-template-columns: 1fr; }
  .receivable-workspace { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; padding: 14px 16px; }
  .sidebar-brand { display: none; }
  .nav { display: flex; grid-template-columns: none; overflow-x: auto; padding-bottom: 5px; }
  .nav-link { flex: 0 0 92px; flex-direction: column; text-align: center; gap: 5px; padding: 8px 6px; font-size: 10px; }
  .nav-link.active { box-shadow: inset 0 -3px 0 #d6ac63; }
  .sidebar-footer { display: none; }
  .report-meta { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .subscription-home.premium-plans { grid-template-columns: 1fr !important; }
}

@media (max-width: 680px) {
  .main { padding: 18px 14px 34px; }
  .topbar { margin-bottom: 18px; }
  .top-actions { display: grid; grid-template-columns: 1fr; }
  .profile-pill, .price-pill { width: 100%; max-width: none; }
  .dashboard-hero { min-height: 0; padding: 25px 20px; border-radius: 24px; }
  .dashboard-hero h3 { font-size: 30px; }
  .hero-actions .btn { width: 100%; }
  .hero-receivable-card { padding: 18px; }
  .hero-status-row { align-items: flex-start; flex-direction: column; }
  .hero-status-row small { text-align: left; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card { min-height: 118px; padding: 16px; }
  .metric-card strong { font-size: 26px; }
  .delivery-progress-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-summary, .finance-summary { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .form-actions, .config-help-card, .plan-page-hero, .signature-head { align-items: stretch; flex-direction: column; }
  .secure-label { width: fit-content; white-space: normal; }
  .report-brand { align-items: flex-start; }
  .report-logo-wrap { width: 75px; height: 62px; }
  .report-meta { grid-template-columns: 1fr; }
  #signatureCanvas { height: 160px; }
}

@media print {
  @page { margin: 10mm; }
  .report-brand { margin-bottom: 12px; }
  .report-meta { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
  .report-meta > div { padding: 7px; border-radius: 8px; }
  .report-cover h3 { font-size: 21px; }
  .report-footer-print { display: grid !important; grid-template-columns: 1fr 1fr 1fr; margin-top: 34px; }
  .report-signature { min-width: 0; }
}
/* V40.2 — tipografia mais limpa, equilibrada e legível */
html,
body,
button,
input,
textarea,
select {
  font-family: var(--font-ui);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
button,
label,
.nav-link,
.eyebrow,
.badge,
.chip,
.alert,
.payment-status-mini {
  font-weight: 700 !important;
}

p,
small,
.muted,
.login-card p,
.dashboard-hero p,
.form-section-title p {
  line-height: 1.55;
}

input,
textarea,
select {
  font-size: 16px;
  line-height: 1.4;
}

th,
td {
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-brand span,
.hero-kicker,
.delivery-progress-grid span,
.report-meta span,
.finance-kpi span {
  font-size: 12px;
  letter-spacing: .055em;
}

.payment-modal-copy textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* V40.4 — painel administrativo, navegação rica e carregamento estável */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #dfe7f1;
  --blue: #2563eb;
  --blue-dark: #0f172a;
  --blue-soft: #eff6ff;
  --orange: #3b82f6;
  --orange-2: #60a5fa;
  --orange-soft: #eff6ff;
  --danger: #dc2626;
  --success: #059669;
  --shadow: 0 18px 48px rgba(15, 23, 42, .08);
  --shadow-soft: 0 8px 26px rgba(15, 23, 42, .06);
  --admin-accent: #3b82f6;
  --admin-accent-strong: #2563eb;
  --admin-sidebar: #0f172a;
  --admin-sidebar-soft: #162238;
}

body {
  background:
    radial-gradient(circle at 82% 0%, rgba(59, 130, 246, .08), transparent 28%),
    var(--bg);
}

.app {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 18px 20px;
  gap: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(59, 130, 246, .2), transparent 31%),
    linear-gradient(180deg, var(--admin-sidebar-soft), var(--admin-sidebar));
  border-right: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 10px 0 34px rgba(15, 23, 42, .09);
}

.sidebar-brand {
  padding: 0 7px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark,
.nav-link.active .nav-icon {
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
}

.sidebar-brand strong {
  font-size: 18px;
  letter-spacing: -.2px;
}

.sidebar-brand span {
  color: #93a4bd;
  font-size: 10px;
  letter-spacing: .13em;
}

.nav-section-title {
  padding: 0 10px;
  color: #718198;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

.nav {
  gap: 6px;
}

.nav-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #a9b6c8;
  text-align: left;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.nav-link:hover {
  color: #eef5ff;
  border-color: rgba(148, 163, 184, .12);
  background: rgba(255, 255, 255, .055);
  transform: translateX(2px);
}

.nav-link.active {
  color: #fff;
  border-color: rgba(96, 165, 250, .24);
  background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(59, 130, 246, .1));
  box-shadow: inset 3px 0 0 #60a5fa, 0 8px 24px rgba(2, 6, 23, .14);
  transform: none;
}

.nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #94a3b8;
  background: rgba(148, 163, 184, .1);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link.active .nav-icon {
  color: #fff;
}

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

.nav-copy strong,
.nav-copy small {
  display: block;
}

.nav-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small {
  overflow: hidden;
  margin-top: 4px;
  color: #718198;
  font-size: 11px;
  font-weight: 400 !important;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link.active .nav-copy small {
  color: #a8c9ff;
}

.nav-arrow {
  color: #65758b;
  font-size: 20px;
  line-height: 1;
  transition: transform .2s ease, color .2s ease;
}

.nav-link.active .nav-arrow {
  color: #93c5fd;
  transform: translateX(2px);
}

.sidebar-footer {
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
}

.main {
  position: relative;
  min-width: 0;
  padding: 30px clamp(22px, 3vw, 44px) 46px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h2 {
  color: var(--blue-dark);
  font-size: clamp(28px, 3vw, 37px);
  letter-spacing: -.8px;
}

.price-pill,
.profile-pill {
  border-color: var(--line);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}

.profile-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

.panel,
.metric-card,
.status-card,
.delivery-progress-panel {
  border-color: var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.panel,
.delivery-progress-panel {
  border-radius: 18px;
}

.dashboard-hero,
.plan-page-hero,
.finance-bank-hero {
  background:
    radial-gradient(circle at 92% 10%, rgba(96, 165, 250, .23), transparent 30%),
    linear-gradient(135deg, #0f172a, #1e3a5f);
  box-shadow: 0 24px 58px rgba(15, 23, 42, .18);
}

.hero-kicker,
.eyebrow {
  color: #2563eb;
}

.dashboard-hero .hero-kicker,
.plan-page-hero .eyebrow,
.finance-bank-hero .eyebrow {
  color: #93c5fd;
}

.btn {
  border-radius: 10px;
  box-shadow: none;
}

.btn.primary,
.btn.payment-red,
.pulse-orange {
  color: #fff !important;
  background: linear-gradient(135deg, var(--admin-accent), var(--admin-accent-strong)) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .2);
  animation: none !important;
}

.btn.outline {
  border-color: #cfd9e7;
  background: #fff;
  color: #334155;
}

input,
textarea,
select {
  border-color: #d7e0eb;
  border-radius: 11px;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .11);
}

#lockBox {
  display: none !important;
}

.page.active {
  animation: adminPageIn .28s cubic-bezier(.2, .75, .25, 1) both;
}

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

.page-transition {
  position: absolute;
  inset: 92px 20px auto;
  z-index: 25;
  min-height: 390px;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.page-transition.visible {
  opacity: 1;
}

.page-transition-card {
  width: 100%;
  min-height: 350px;
  padding: 28px;
  border: 1px solid rgba(207, 217, 231, .9);
  border-radius: 18px;
  background: rgba(248, 250, 252, .94);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .09);
  backdrop-filter: blur(7px);
}

.page-transition-card > strong {
  display: block;
  margin: 14px 0 23px;
  color: #334155;
  font-size: 14px;
}

.route-loader {
  display: flex;
  gap: 5px;
}

.route-loader span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--admin-accent);
  animation: routeDot .85s ease-in-out infinite alternate;
}

.route-loader span:nth-child(2) { animation-delay: .12s; }
.route-loader span:nth-child(3) { animation-delay: .24s; }

@keyframes routeDot {
  from { opacity: .35; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}

.skeleton-line,
.skeleton-grid i {
  display: block;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  background: #e8eef6;
}

.skeleton-line::after,
.skeleton-grid i::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: skeletonSweep 1.25s infinite;
}

.skeleton-line.wide {
  width: 52%;
  height: 18px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.skeleton-grid i {
  min-height: 165px;
}

@keyframes skeletonSweep {
  100% { transform: translateX(100%); }
}

.loading-overlay {
  place-items: end center;
  padding: 22px;
  background: rgba(15, 23, 42, .14);
  backdrop-filter: blur(2px);
}

.loading-card {
  width: min(390px, 100%);
  grid-template-columns: 34px 1fr;
  justify-items: start;
  gap: 3px 13px;
  padding: 15px 18px;
  border: 1px solid rgba(207, 217, 231, .9);
  border-radius: 14px;
  text-align: left;
}

.loading-card .spinner {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-width: 3px;
  border-top-color: var(--admin-accent);
}

.loading-card small {
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 140;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid #dce5f0;
  border-radius: 14px;
  color: #1e293b;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  opacity: 0;
  pointer-events: auto;
  transform: translateX(24px);
  transition: opacity .22s ease, transform .22s ease;
}

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

.app-toast.leaving {
  opacity: 0;
  transform: translateX(18px);
}

.toast-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #1d4ed8;
  background: #dbeafe;
  font-weight: 700;
}

.app-toast.success .toast-icon {
  color: #047857;
  background: #d1fae5;
}

.app-toast.error .toast-icon {
  color: #b91c1c;
  background: #fee2e2;
}

.app-toast strong {
  display: block;
  font-size: 13px;
}

.app-toast p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.toast-close,
.notice-close {
  border: 0;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.subscription-notice {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(7px);
  animation: noticeBackdropIn .18s ease both;
}

.subscription-notice.closing {
  opacity: 0;
  transition: opacity .18s ease;
}

.subscription-notice-card {
  position: relative;
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(219, 228, 240, .9);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
  animation: noticeCardIn .25s cubic-bezier(.2, .8, .2, 1) both;
}

.notice-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.notice-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 15px;
  color: #1d4ed8;
  background: #dbeafe;
}

.notice-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-kicker {
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.subscription-notice-card h3 {
  margin: 7px 0 8px;
  color: #0f172a;
  font-size: 27px;
}

.subscription-notice-card > p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.notice-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 18px;
  padding: 15px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #f8fafc;
}

.notice-plan small,
.notice-plan strong {
  display: block;
}

.notice-plan small {
  color: #64748b;
}

.notice-plan strong {
  margin-top: 3px;
  color: #1e293b;
  font-size: 14px;
}

.notice-plan > span {
  color: #1d4ed8;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.notice-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.notice-timer {
  margin-top: 18px;
  color: #64748b;
  font-size: 12px;
}

.notice-timer i {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: #2563eb;
  transform-origin: left;
}

.subscription-notice.running .notice-timer i {
  animation: noticeTimer 10s linear forwards;
}

@keyframes noticeTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes noticeBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes noticeCardIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 11px 13px;
    border-radius: 0;
  }

  .sidebar-brand,
  .nav-section-title,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 0 5px;
  }

  .nav-link {
    flex: 0 0 84px;
    display: flex;
    min-height: 68px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 7px 5px;
    text-align: center;
  }

  .nav-icon {
    width: 32px;
    height: 32px;
  }

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

  .nav-copy strong {
    font-size: 10px;
  }

  .nav-copy small,
  .nav-arrow {
    display: none;
  }

  .nav-link.active {
    box-shadow: inset 0 -3px 0 #60a5fa;
  }

  .page-transition {
    inset: 104px 4px auto;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px 14px 84px;
  }

  .toast-stack {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .subscription-notice {
    align-items: end;
    padding: 12px;
  }

  .subscription-notice-card {
    padding: 25px 20px 20px;
    border-radius: 20px 20px 14px 14px;
  }

  .notice-plan {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .notice-actions .btn {
    width: 100%;
  }

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

  .skeleton-grid i:nth-child(n+2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page.active,
  .route-loader span,
  .skeleton-line::after,
  .skeleton-grid i::after,
  .subscription-notice,
  .subscription-notice-card,
  .subscription-notice.running .notice-timer i {
    animation: none !important;
  }
}

/* V40.5 — identidade quente para restaurante e relatório institucional */
:root {
  --bg: #fff7ed;
  --panel: #ffffff;
  --text: #3b241b;
  --muted: #78645b;
  --line: #f0d9c8;
  --blue: #ea580c;
  --blue-dark: #7c2d12;
  --blue-soft: #fff1e6;
  --orange: #f97316;
  --orange-2: #fb923c;
  --orange-soft: #ffedd5;
  --shadow: 0 18px 48px rgba(124, 45, 18, .1);
  --shadow-soft: 0 8px 26px rgba(124, 45, 18, .075);
  --admin-accent: #f97316;
  --admin-accent-strong: #c2410c;
  --admin-sidebar: #681f0d;
  --admin-sidebar-soft: #9a3412;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 84% 0%, rgba(249, 115, 22, .12), transparent 29%),
    linear-gradient(180deg, #fffaf5 0%, var(--bg) 100%);
}

::selection {
  color: #fff;
  background: #ea580c;
}

.login-screen {
  background:
    radial-gradient(circle at 18% 15%, rgba(251, 146, 60, .22), transparent 28%),
    linear-gradient(145deg, #fffaf5, #ffedd5);
}

.login-card {
  border-color: rgba(240, 217, 200, .92);
  box-shadow: 0 28px 75px rgba(124, 45, 18, .14);
}

.sidebar {
  background:
    radial-gradient(circle at 18% 0%, rgba(251, 146, 60, .28), transparent 31%),
    linear-gradient(180deg, var(--admin-sidebar-soft), var(--admin-sidebar));
  border-right-color: rgba(255, 237, 213, .14);
  box-shadow: 10px 0 34px rgba(67, 20, 7, .14);
}

.brand-mark,
.nav-link.active .nav-icon {
  color: #fff;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  box-shadow: 0 10px 24px rgba(194, 65, 12, .32);
}

.sidebar-brand {
  border-bottom-color: rgba(255, 237, 213, .13);
}

.sidebar-brand span,
.nav-section-title {
  color: #fdba74;
}

.nav-link {
  color: #fed7aa;
}

.nav-link:hover {
  color: #fff7ed;
  border-color: rgba(255, 237, 213, .17);
  background: rgba(255, 247, 237, .09);
}

.nav-link.active {
  color: #fff;
  border-color: rgba(253, 186, 116, .28);
  background: linear-gradient(90deg, rgba(249, 115, 22, .36), rgba(251, 146, 60, .12));
  box-shadow: inset 3px 0 0 #fdba74, 0 8px 24px rgba(67, 20, 7, .2);
}

.nav-icon {
  color: #fdba74;
  background: rgba(255, 237, 213, .1);
}

.nav-copy small {
  color: #d6a786;
}

.nav-link.active .nav-copy small,
.nav-link.active .nav-arrow {
  color: #fed7aa;
}

.nav-arrow {
  color: #c88b68;
}

.sidebar-footer {
  border-color: rgba(255, 237, 213, .14);
  background: rgba(255, 247, 237, .07);
}

.topbar h2,
.panel h3,
.panel h4,
.subscription-notice-card h3 {
  color: #431407;
}

.eyebrow,
.hero-kicker,
.price-pill strong {
  color: #ea580c;
}

.price-pill,
.profile-pill,
.panel,
.metric-card,
.status-card,
.delivery-progress-panel {
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero,
.plan-page-hero,
.finance-bank-hero {
  background:
    radial-gradient(circle at 92% 10%, rgba(253, 186, 116, .3), transparent 31%),
    linear-gradient(135deg, #7c2d12, #c2410c);
  box-shadow: 0 24px 58px rgba(124, 45, 18, .22);
}

.dashboard-hero .hero-kicker,
.plan-page-hero .eyebrow,
.finance-bank-hero .eyebrow {
  color: #fed7aa;
}

.btn.primary,
.btn.payment-red,
.pulse-orange {
  color: #fff !important;
  background: linear-gradient(135deg, #f97316, #c2410c) !important;
  box-shadow: 0 8px 20px rgba(194, 65, 12, .24);
}

.btn.outline {
  border-color: #ead0bd;
  color: #5b3020;
  background: #fff;
}

.btn:hover {
  filter: saturate(1.06) brightness(.99);
}

input,
textarea,
select {
  border-color: #ead6c8;
  color: #3b241b;
  background: #fffdfa;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .13);
}

.table-wrap {
  border-color: #efddcf;
}

thead th {
  color: #6b2b13;
  background: #fff1e6;
}

tbody tr:hover {
  background: #fffaf5;
}

.page-transition-card {
  border-color: rgba(240, 217, 200, .96);
  background: rgba(255, 250, 245, .96);
  box-shadow: 0 22px 55px rgba(124, 45, 18, .11);
}

.route-loader span,
.notice-timer i {
  background: #f97316;
}

.skeleton-line,
.skeleton-grid i {
  background: #f4e4d7;
}

.loading-overlay {
  background: rgba(67, 20, 7, .18);
}

.loading-card,
.app-toast {
  border-color: #efd9c9;
  box-shadow: 0 18px 45px rgba(124, 45, 18, .16);
}

.toast-icon,
.notice-icon {
  color: #c2410c;
  background: #ffedd5;
}

.subscription-notice {
  background: rgba(67, 20, 7, .52);
}

.subscription-notice-card {
  border-color: #f0dac9;
  box-shadow: 0 30px 90px rgba(67, 20, 7, .32);
}

.notice-kicker,
.notice-plan > span {
  color: #ea580c;
}

.notice-plan {
  border-color: #efd8c6;
  background: #fffaf5;
}

.report-cover {
  border: 1px solid #f0d4bf;
  background:
    radial-gradient(circle at 95% 0%, rgba(251, 146, 60, .13), transparent 30%),
    linear-gradient(145deg, #fffaf5, #fff);
}

.report-cover h3 {
  color: #7c2d12;
}

.report-logo-wrap {
  border-color: #efd5c2;
  background: #fff;
}

.report-meta {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-meta > div {
  border-color: #f0dac9;
  background: rgba(255, 255, 255, .88);
}

.report-meta > div:nth-child(-n+3) {
  grid-column: span 2;
}

.report-meta > div:nth-child(n+4) {
  grid-column: span 3;
}

.report-meta span {
  color: #9a5b3f;
}

.report-meta strong {
  color: #5c2714;
}

.report-summary > div {
  border-color: #f2cfb3;
  background: linear-gradient(145deg, #fff7ed, #fffaf5);
}

.report-summary strong {
  color: #c2410c;
}

.report-footer-print {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(2, minmax(160px, 1fr));
  align-items: end;
  gap: 22px;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid #f0d4bf;
  border-radius: 15px;
  color: #5b3020;
  background: #fffaf5;
}

.report-company-info {
  display: grid;
  align-self: stretch;
  align-content: start;
  gap: 4px;
}

.report-footer-label {
  margin-bottom: 4px;
  color: #ea580c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}

.report-company-info > strong {
  color: #431407;
  font-size: 15px;
}

.report-generated-at {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0d4bf;
  color: #8a5a43;
}

.report-signature {
  border-top-color: #a85a34;
}

@media (max-width: 900px) {
  .nav-link.active {
    box-shadow: inset 0 -3px 0 #fdba74;
  }

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

  .report-meta > div:nth-child(n) {
    grid-column: span 1;
  }

  .report-meta > div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .report-meta {
    grid-template-columns: 1fr;
  }

  .report-meta > div:nth-child(n),
  .report-meta > div:last-child {
    grid-column: 1;
  }

  .report-footer-print {
    grid-template-columns: 1fr;
  }
}

@media print {
  :root {
    --text: #2f1d16;
    --muted: #68574f;
    --line: #e4cfc0;
    --blue: #c2410c;
    --blue-dark: #7c2d12;
    --blue-soft: #fff7ed;
  }

  .report-cover {
    border-color: #dfb89d !important;
    background: #fff !important;
  }

  .report-meta {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .report-meta > div:nth-child(-n+3) {
    grid-column: span 2 !important;
  }

  .report-meta > div:nth-child(n+4) {
    grid-column: span 3 !important;
  }

  .report-summary > div {
    border-color: #e6c2a8 !important;
    background: #fffaf5 !important;
  }

  .report-footer-print {
    display: grid !important;
    grid-template-columns: minmax(220px, 1.45fr) repeat(2, minmax(145px, 1fr)) !important;
    gap: 16px !important;
    padding: 16px !important;
    border-color: #dfb89d !important;
    border-radius: 10px !important;
    background: #fffaf5 !important;
  }
}

/* V40.6 — precedência final do relatório após a identidade V40.5 */
.report-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-meta > div:nth-child(n) {
  grid-column: auto;
}

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

  .report-meta > div:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .report-meta {
    grid-template-columns: 1fr;
  }

  .report-meta > div:nth-child(n) {
    grid-column: auto;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  .report-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .report-meta > div:nth-child(n) {
    grid-column: auto !important;
  }

  .report-footer-print {
    grid-template-columns: minmax(220px, 1.45fr) repeat(2, minmax(145px, 1fr)) !important;
  }
}

/* V40.8 — aplicativo móvel instalável */
.mobile-app-header,
.mobile-dashboard-summary,
.mobile-bottom-nav,
.mobile-more-overlay,
.install-banner {
  display: none;
}

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

.photo-capture-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px dashed #e7c5ae;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffaf5, #fff1e6);
}

.photo-capture-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-capture-copy strong,
.photo-capture-copy small {
  display: block;
}

.photo-capture-copy small {
  margin-top: 2px;
  color: var(--muted);
}

.photo-capture-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #c2410c;
  background: #ffedd5;
}

.photo-capture-icon svg,
.camera-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #c2410c);
  box-shadow: 0 8px 20px rgba(194, 65, 12, .2);
  font-weight: 850;
  cursor: pointer;
}

.saida-photo-preview {
  grid-column: 1 / -1;
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #ead6c8;
  background: #fff;
}

.saida-photo-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.saida-photo-preview .remove-saida-photo {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: rgba(127, 29, 29, .9);
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  font-weight: 800;
  cursor: pointer;
}

.install-help-content {
  display: grid;
  gap: 14px;
  color: var(--muted);
}

.install-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf5;
}

.install-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #ea580c;
  font-weight: 900;
}

.install-step strong,
.install-step small {
  display: block;
}

.install-step small {
  margin-top: 3px;
  line-height: 1.45;
}

body.pwa-standalone .mobile-install-button,
body.pwa-standalone #installBanner {
  display: none !important;
}

@media (max-width: 900px) {
  html,
  body {
    min-height: 100%;
    overscroll-behavior-y: none;
  }

  body {
    background: #fff8f1;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .app {
    display: block;
    min-height: 100dvh;
  }

  .sidebar,
  .topbar {
    display: none !important;
  }

  .main {
    min-height: 100dvh;
    padding: calc(84px + env(safe-area-inset-top)) 14px calc(94px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .mobile-app-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 70;
    min-height: calc(72px + env(safe-area-inset-top));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    color: #fff;
    background:
      radial-gradient(circle at 15% 0%, rgba(251, 146, 60, .42), transparent 36%),
      linear-gradient(135deg, #9a3412, #6b210d);
    box-shadow: 0 10px 30px rgba(67, 20, 7, .2);
  }

  .mobile-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-brand-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.24);
    border-radius: 15px;
    color: #7c2d12;
    background: #fff7ed;
    box-shadow: 0 8px 20px rgba(67, 20, 7, .2);
    font-weight: 950;
    letter-spacing: -.04em;
  }

  .mobile-brand-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
  }

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

  .mobile-brand-copy strong,
  .mobile-brand-copy small {
    display: block;
  }

  .mobile-brand-copy strong {
    max-width: min(58vw, 290px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.2;
  }

  .mobile-brand-copy small {
    margin-top: 3px;
    color: #fed7aa;
    font-size: 11px;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-icon-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.19);
    border-radius: 14px;
    color: #fff;
    background: rgba(255,255,255,.1);
    cursor: pointer;
  }

  .mobile-icon-btn svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-dashboard-summary {
    display: block;
    margin-bottom: 14px;
    padding: 20px;
    border-radius: 24px;
    color: #fff;
    background:
      radial-gradient(circle at 92% 5%, rgba(253, 186, 116, .34), transparent 32%),
      linear-gradient(145deg, #7c2d12, #c2410c);
    box-shadow: 0 18px 42px rgba(124, 45, 18, .24);
  }

  .mobile-summary-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fed7aa;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  .mobile-eye-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.1);
  }

  .mobile-eye-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .mobile-dashboard-summary > strong {
    display: block;
    margin: 4px 0 9px;
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.05;
    letter-spacing: -.055em;
  }

  .mobile-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
  }

  .mobile-summary-meta span {
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    color: #ffedd5;
    background: rgba(255,255,255,.08);
    font-size: 12px;
  }

  .mobile-primary-action {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 0;
    border-radius: 18px;
    color: #7c2d12;
    background: #fff7ed;
    box-shadow: 0 12px 26px rgba(67, 20, 7, .18);
    text-align: left;
    cursor: pointer;
  }

  .mobile-action-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    font-size: 28px;
    font-weight: 400;
  }

  .mobile-primary-action strong,
  .mobile-primary-action small {
    display: block;
  }

  .mobile-primary-action strong {
    font-size: 16px;
  }

  .mobile-primary-action small {
    margin-top: 2px;
    color: #8f5a45;
    font-size: 11px;
  }

  .mobile-action-arrow {
    color: #c2410c;
    font-size: 28px;
  }

  .mobile-secondary-action {
    width: 100%;
    min-height: 45px;
    margin-top: 9px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 14px;
    color: #fff7ed;
    background: rgba(255,255,255,.08);
    font-weight: 750;
  }

  .install-banner {
    position: relative;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 42px 12px 12px;
    border: 1px solid #f0d9c8;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .install-banner:not(.hidden) {
    display: flex;
  }

  .install-banner img {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 13px;
  }

  .install-banner > div {
    min-width: 0;
    flex: 1;
  }

  .install-banner strong,
  .install-banner small {
    display: block;
  }

  .install-banner small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
  }

  .install-banner-close {
    position: absolute;
    top: 5px;
    right: 8px;
    border: 0;
    color: #9b7a69;
    background: transparent;
    font-size: 22px;
  }

  #page-dashboard .dashboard-hero,
  #page-dashboard > .cards-grid,
  #page-dashboard > .dashboard-toolbar,
  #page-dashboard > .delivery-progress-panel {
    display: none;
  }

  #page-dashboard .two-columns {
    display: block;
  }

  #page-dashboard .two-columns > .panel:nth-child(2) {
    display: none;
  }

  #page-dashboard .two-columns > .panel:first-child {
    padding: 16px;
    border-radius: 20px;
  }

  #page-dashboard .two-columns > .panel:first-child .panel-header {
    align-items: center;
  }

  #page-dashboard .two-columns > .panel:first-child .panel-header .btn {
    display: none;
  }

  .page {
    animation: none;
  }

  .panel,
  .wide-panel,
  .metric-card,
  .status-card,
  .delivery-progress-panel {
    border-radius: 20px;
  }

  .panel {
    padding: 17px;
  }

  .panel-header {
    gap: 10px;
  }

  .panel-header h3 {
    font-size: 20px;
  }

  .panel-header p {
    font-size: 13px;
  }

  .saida-form,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .two-columns,
  .report-summary,
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  label {
    font-size: 13px;
  }

  input,
  textarea,
  select,
  .btn,
  .camera-button {
    min-height: 48px;
    font-size: 16px;
  }

  textarea {
    min-height: 96px;
  }

  .photo-capture-card {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .camera-button {
    width: 100%;
  }

  .calc-box {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }

  .calc-box strong {
    font-size: 17px;
  }

  .big-btn {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
  }

  .filter-row.compact {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-row.compact > * {
    width: 100%;
  }

  .records-table-wrap {
    border: 0;
    overflow: visible;
    background: transparent;
  }

  .records-table,
  .records-table tbody,
  .records-table tr,
  .records-table td {
    display: block;
    width: 100%;
  }

  .records-table thead {
    display: none;
  }

  .records-table tbody {
    display: grid;
    gap: 12px;
  }

  .records-table tr {
    overflow: hidden;
    border: 1px solid #f0d9c8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(124, 45, 18, .07);
  }

  .records-table td {
    position: relative;
    min-height: 42px;
    padding: 11px 12px 11px 42%;
    border-bottom: 1px solid #f7e8dc;
    text-align: right;
  }

  .records-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 12px;
    width: 36%;
    color: #8f5a45;
    font-size: 11px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .records-table td:last-child {
    padding: 12px;
    border-bottom: 0;
  }

  .records-table td:last-child::before {
    display: none;
  }

  .records-table .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .records-table .actions .proof-btn {
    grid-column: 1 / -1;
  }

  .records-table .actions .btn {
    width: 100%;
  }

  .proof-photo-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding: 4px 7px;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
    font-size: 10px;
    font-weight: 800;
  }

  .table-wrap:not(.records-table-wrap) {
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card,
  .proof-modal-card,
  .install-help-card {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .signature-box canvas {
    min-height: 190px;
  }

  .payment-modal {
    align-items: flex-end;
    padding: 0;
  }

  .payment-modal-card {
    width: 100%;
    max-height: 94dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .support-float {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 75;
    min-height: calc(72px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(231, 197, 174, .92);
    background: rgba(255, 253, 250, .96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -10px 28px rgba(67, 20, 7, .1);
  }

  .mobile-nav-link {
    min-width: 0;
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border: 0;
    border-radius: 14px;
    color: #8b6a5b;
    background: transparent;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
  }

  .mobile-nav-link svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav-link.active {
    color: #c2410c;
    background: #fff1e6;
  }

  .mobile-nav-primary {
    margin-top: -25px;
    color: #7c2d12;
  }

  .mobile-nav-primary.active {
    background: transparent;
  }

  .mobile-nav-plus {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 4px solid #fffdfa;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #fb923c, #c2410c);
    box-shadow: 0 8px 22px rgba(194, 65, 12, .3);
    font-size: 29px;
    font-weight: 400;
    line-height: 1;
  }

  .mobile-more-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
  }

  .mobile-more-overlay:not(.hidden) {
    display: block;
  }

  .mobile-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 18, 9, .5);
    backdrop-filter: blur(5px);
  }

  .mobile-more-sheet {
    position: absolute;
    inset: auto 0 0 0;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 9px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    background: #fffaf5;
    box-shadow: 0 -24px 60px rgba(43, 18, 9, .24);
    animation: mobileSheetIn .2s ease both;
  }

  @keyframes mobileSheetIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .mobile-sheet-handle {
    width: 48px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #e5c7b4;
  }

  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-more-head small {
    color: #ea580c;
    font-weight: 900;
    letter-spacing: .12em;
  }

  .mobile-more-head h3 {
    margin: 2px 0 0;
    font-size: 24px;
  }

  .mobile-sheet-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    color: #7c2d12;
    background: #ffedd5;
    font-size: 25px;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mobile-more-link {
    min-height: 108px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 14px;
    border: 1px solid #f0d9c8;
    border-radius: 18px;
    color: #431407;
    background: #fff;
    box-shadow: 0 7px 18px rgba(124, 45, 18, .06);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-more-link > span {
    font-size: 22px;
  }

  .mobile-more-link strong,
  .mobile-more-link small {
    display: block;
  }

  .mobile-more-link strong {
    margin-top: 7px;
    font-size: 14px;
  }

  .mobile-more-link small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-more-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .mobile-more-footer .btn {
    width: 100%;
  }

  .page-transition {
    inset: calc(78px + env(safe-area-inset-top)) 8px auto;
    z-index: 68;
  }

  .loading-overlay {
    z-index: 160;
  }

  .toast-stack {
    top: calc(78px + env(safe-area-inset-top));
    z-index: 165;
  }

  .login-screen {
    min-height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .login-card .brand-mark {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 560px) {
  .main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mobile-dashboard-summary {
    padding: 18px;
    border-radius: 22px;
  }

  .mobile-brand-copy strong {
    max-width: 52vw;
  }

  .panel {
    padding: 15px;
  }

  .calc-box {
    grid-template-columns: 1fr;
  }

  .mobile-more-footer {
    grid-template-columns: 1fr;
  }

  .install-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .install-banner .btn {
    width: 100%;
  }
}

@media print {
  .mobile-app-header,
  .mobile-bottom-nav,
  .mobile-more-overlay,
  .mobile-dashboard-summary,
  .install-banner,
  .photo-capture-card {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .install-banner {
    align-items: center;
    flex-wrap: nowrap;
  }

  .install-banner .btn {
    width: auto;
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }
}

/* V40.9 — correções exclusivas do aplicativo móvel */
.page-loader-symbol {
  width: 52px;
  height: 52px;
  display: none;
  place-items: center;
  position: relative;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #fb923c, #c2410c);
  box-shadow: 0 12px 28px rgba(194, 65, 12, .22);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -.03em;
}

.page-loader-symbol::before,
.page-loader-symbol::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(234, 88, 12, .22);
  border-radius: 22px;
  animation: mobileLoaderPulse 1.45s ease-out infinite;
}

.page-loader-symbol::after {
  animation-delay: .55s;
}

@keyframes mobileLoaderPulse {
  0% { opacity: .9; transform: scale(.78); }
  75%, 100% { opacity: 0; transform: scale(1.28); }
}

.mobile-delivery-summary,
.mobile-records-list,
.mobile-records-kicker,
.mobile-filter-toggle,
.mobile-records-copy,
.mobile-date-label,
.mobile-filter-label {
  display: none;
}

.records-filters {
  align-items: end;
}

.delivery-main-filters,
.delivery-advanced-filters,
.delivery-filter-actions {
  display: contents;
}

.delivery-advanced-filters label {
  min-width: 170px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  .mobile-more-sheet::-webkit-scrollbar,
  .modal-card::-webkit-scrollbar,
  .payment-modal-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  body.action-loading,
  body.page-area-loading {
    overflow: hidden !important;
    touch-action: none;
  }

  .app,
  .main,
  .page,
  .panel,
  .wide-panel,
  .records-panel,
  .mobile-more-sheet {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .main {
    overflow-x: hidden !important;
    contain: inline-size;
  }

  .page {
    overflow-x: clip;
  }

  #page-registros,
  #page-registros *,
  .mobile-more-overlay,
  .mobile-more-overlay * {
    touch-action: manipulation;
  }

  /* A área de entregas passa a usar cartões, sem tabela larga ou zoom lateral. */
  .records-panel {
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: none;
  }

  .records-header {
    display: block;
    margin: 0 0 12px;
    padding: 18px 16px 16px;
    border: 1px solid #f0d9c8;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(124, 45, 18, .07);
  }

  .records-heading {
    min-width: 0;
  }

  .desktop-records-copy,
  .desktop-filter-label {
    display: none !important;
  }

  .mobile-records-copy,
  .mobile-date-label,
  .mobile-filter-label {
    display: block;
  }

  .mobile-records-kicker {
    display: block;
    margin-bottom: 5px;
    color: #ea580c;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .12em;
  }

  .records-heading h3 {
    margin: 0;
    color: #431407;
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -.025em;
  }

  .records-heading p {
    max-width: 34rem;
    margin: 7px 0 0;
    color: #8f6d5c;
    font-size: 13px;
    line-height: 1.45;
  }

  .mobile-delivery-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 15px 0 13px;
  }

  .mobile-delivery-summary > div {
    min-width: 0;
    padding: 11px 8px;
    border: 1px solid #f3dfd1;
    border-radius: 15px;
    background: #fffaf5;
    text-align: center;
  }

  .mobile-delivery-summary > div.success {
    border-color: #cce8da;
    background: #f0faf5;
  }

  .mobile-delivery-summary span,
  .mobile-delivery-summary strong {
    display: block;
  }

  .mobile-delivery-summary span {
    overflow: hidden;
    color: #9b7867;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: .035em;
  }

  .mobile-delivery-summary strong {
    margin-top: 5px;
    color: #7c2d12;
    font-size: 22px;
    line-height: 1;
  }

  .mobile-delivery-summary .success strong {
    color: #20734e;
  }

  .records-filters {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .delivery-main-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .records-filters input,
  .records-filters select,
  .records-filters .btn {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .delivery-advanced-filters {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 11px;
    border: 1px solid #f3dfd1;
    border-radius: 15px;
    background: #fffaf5;
  }

  .delivery-advanced-filters.open {
    display: grid;
    animation: deliveryFiltersIn .18s ease both;
  }

  @keyframes deliveryFiltersIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .delivery-advanced-filters label {
    min-width: 0;
    font-size: 10px;
  }

  .delivery-filter-actions {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 9px;
  }

  .mobile-filter-toggle {
    display: inline-flex;
  }

  .mobile-filter-toggle[aria-expanded="true"] {
    border-color: #ea580c;
    color: #c2410c;
    background: #fff1e6;
  }

  .records-table-wrap {
    display: none !important;
  }

  .mobile-records-list {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 12px;
  }

  .mobile-delivery-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #efd8c7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 9px 25px rgba(124, 45, 18, .075);
  }

  .mobile-delivery-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 15px 15px 12px;
    border-bottom: 1px solid #f8e9dd;
  }

  .mobile-delivery-card-head > div {
    min-width: 0;
  }

  .mobile-delivery-date {
    display: block;
    margin-bottom: 4px;
    color: #b45309;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
  }

  .mobile-delivery-card h4 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #431407;
    font-size: 17px;
    line-height: 1.25;
  }

  .mobile-delivery-requester {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: #8b6a5b;
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-delivery-card .delivery-badge {
    flex: 0 0 auto;
    max-width: 104px;
    padding: 6px 8px;
    font-size: 9px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .mobile-delivery-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 15px;
  }

  .mobile-delivery-totals > div {
    min-width: 0;
    padding: 11px;
    border-radius: 14px;
    background: #fff8f1;
  }

  .mobile-delivery-totals span,
  .mobile-delivery-totals strong {
    display: block;
  }

  .mobile-delivery-totals span {
    color: #9b7867;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .mobile-delivery-totals strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #7c2d12;
    font-size: 17px;
    line-height: 1.15;
  }

  .mobile-delivery-info {
    display: grid;
    gap: 9px;
    padding: 1px 15px 14px;
  }

  .mobile-delivery-info-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .mobile-delivery-info-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #c2410c;
    background: #ffedd5;
    font-size: 15px;
  }

  .mobile-delivery-info-row small,
  .mobile-delivery-info-row strong {
    display: block;
    overflow-wrap: anywhere;
  }

  .mobile-delivery-info-row small {
    color: #9b7867;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .035em;
  }

  .mobile-delivery-info-row strong {
    margin-top: 2px;
    color: #59301f;
    font-size: 13px;
    line-height: 1.35;
  }

  .mobile-delivery-proof-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 15px 13px;
    padding: 9px 10px;
    border-radius: 12px;
    color: #166534;
    background: #ecfdf3;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-delivery-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 15px 15px;
    border-top: 1px solid #f8e9dd;
    background: #fffdfb;
  }

  .mobile-delivery-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 9px;
    font-size: 12px;
  }

  .mobile-delivery-actions .proof-btn {
    grid-column: 1 / -1;
  }

  .mobile-delivery-empty {
    padding: 30px 20px;
    border: 1px dashed #e7c5ae;
    border-radius: 20px;
    color: #8f6d5c;
    background: #fffaf5;
    text-align: center;
  }

  .mobile-delivery-empty strong,
  .mobile-delivery-empty span {
    display: block;
  }

  .mobile-delivery-empty strong {
    color: #7c2d12;
    font-size: 17px;
  }

  .mobile-delivery-empty span {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.45;
  }

  /* Carregamentos fixos no centro do ecrã, sem deslocamento lateral. */
  .loading-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 16px;
    background: rgba(67, 20, 7, .3);
    backdrop-filter: blur(8px);
    overscroll-behavior: contain;
    touch-action: none;
  }

  .loading-card {
    width: min(286px, calc(100vw - 32px));
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 4px 13px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 22px;
    background: rgba(255, 253, 250, .98);
    box-shadow: 0 24px 70px rgba(67, 20, 7, .28);
    text-align: left;
  }

  .loading-card .spinner {
    grid-row: 1 / 3;
    position: relative;
    width: 54px;
    height: 54px;
    border: 4px solid #ffedd5;
    border-top-color: #ea580c;
    border-right-color: #fb923c;
    border-radius: 999px;
    animation: spin .78s linear infinite;
  }

  .loading-card .spinner::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 999px;
    background: radial-gradient(circle, #fb923c 0 24%, #fff7ed 26% 100%);
    animation: loadingCorePulse .9s ease-in-out infinite alternate;
  }

  @keyframes loadingCorePulse {
    from { transform: scale(.82); opacity: .75; }
    to { transform: scale(1.08); opacity: 1; }
  }

  .loading-card strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #431407;
    font-size: 15px;
    line-height: 1.25;
  }

  .loading-card small {
    max-width: 100%;
    color: #9b7867;
    font-size: 11px;
    line-height: 1.3;
  }

  .page-transition {
    position: fixed;
    inset: 0;
    z-index: 155;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 16px;
    background: rgba(67, 20, 7, .26);
    backdrop-filter: blur(7px);
    pointer-events: none;
    touch-action: none;
  }

  .page-transition.visible {
    pointer-events: auto;
  }

  .page-transition-card {
    width: min(270px, calc(100vw - 32px));
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    justify-items: center;
    padding: 25px 20px 21px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 24px;
    background: rgba(255, 253, 250, .98);
    box-shadow: 0 24px 70px rgba(67, 20, 7, .26);
    text-align: center;
  }

  .page-transition-card .page-loader-symbol {
    display: grid;
    margin-bottom: 15px;
  }

  .page-transition-card .route-loader {
    justify-content: center;
    gap: 6px;
  }

  .page-transition-card .route-loader span {
    width: 7px;
    height: 7px;
    background: #ea580c;
  }

  .page-transition-card > strong {
    margin: 12px 0 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #59301f;
    font-size: 14px;
    line-height: 1.35;
  }

  .page-transition-card .skeleton-line,
  .page-transition-card .skeleton-grid {
    display: none;
  }

  .mobile-more-overlay {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .mobile-more-sheet {
    overflow-x: hidden;
  }
}

@media (max-width: 380px) {
  .mobile-delivery-summary {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-delivery-summary > div:first-child {
    grid-column: 1 / -1;
  }

  .delivery-advanced-filters,
  .delivery-filter-actions {
    grid-template-columns: 1fr;
  }
}

/* V40.10 - Splash de entrada mobile e centralização reforçada do login */
body.intro-open {
  overflow: hidden;
}

.app-intro-splash {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.app-intro-splash.hidden {
  display: none !important;
}

.app-intro-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(245,130,32,.22), transparent 28%),
    linear-gradient(180deg, rgba(9,19,31,.985), rgba(15,28,42,.985));
}

.app-intro-card {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  color: #fff;
  animation: appIntroFade 3s ease both;
}

.app-intro-rings {
  position: absolute;
  inset: -32px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.app-intro-rings span {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  animation: appIntroRing 2.6s ease-out infinite;
}

.app-intro-rings span:nth-child(1) { width: 134px; height: 134px; animation-delay: 0s; }
.app-intro-rings span:nth-child(2) { width: 168px; height: 168px; animation-delay: .28s; }
.app-intro-rings span:nth-child(3) { width: 204px; height: 204px; animation-delay: .56s; }

.app-intro-brand {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(245,130,32,1), rgba(255,173,94,.96));
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -.06em;
  box-shadow: 0 26px 60px rgba(245,130,32,.34);
  overflow: hidden;
  animation: appIntroLogo 3s cubic-bezier(.2,.8,.2,1) both;
}

.app-intro-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-intro-card strong {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.03em;
  max-width: 260px;
}

.app-intro-card small {
  color: rgba(255,255,255,.78);
  font-size: 14px;
  letter-spacing: .02em;
}

@keyframes appIntroFade {
  0% { opacity: 0; transform: translateY(8px); }
  12% { opacity: 1; transform: translateY(0); }
  84% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes appIntroLogo {
  0% { transform: scale(.72) rotate(-8deg); filter: saturate(.9); }
  16% { transform: scale(1.08) rotate(0deg); filter: saturate(1.04); }
  24% { transform: scale(1); }
  70% { transform: scale(1); }
  84% { transform: scale(.96); }
  100% { transform: scale(.92); }
}

@keyframes appIntroRing {
  0% { transform: scale(.72); opacity: 0; }
  18% { opacity: .46; }
  100% { transform: scale(1.1); opacity: 0; }
}

.login-screen {
  place-items: center;
  align-items: center;
  justify-items: center;
}

.login-card {
  margin-inline: auto;
}

@media (max-width: 900px) {
  .login-screen {
    min-height: 100dvh;
    place-items: center !important;
    align-items: center !important;
    justify-items: center !important;
    align-content: center;
  }

  .login-card {
    width: min(440px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .login-screen {
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .login-card {
    padding: 24px 20px;
  }
}

/* V40.12 — módulo de vendas, rolagem mobile e edição segura */
.desktop-system-switch {
  min-height: 46px;
  white-space: nowrap;
}

.photo-source-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.gallery-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #e7c5ae;
  border-radius: 14px;
  color: #9a3412;
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.gallery-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.proof-photo-source {
  display: grid;
  gap: 10px;
}

.sales-page {
  width: 100%;
}

.sales-shell {
  display: grid;
  gap: 18px;
}

.sales-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.17), transparent 28%),
    linear-gradient(135deg, #155e75, #0f766e);
  box-shadow: 0 18px 42px rgba(15,118,110,.2);
}

.sales-hero .eyebrow { color: #ccfbf1; }
.sales-hero h3 { margin: 4px 0 6px; font-size: 29px; }
.sales-hero p { margin: 0; color: rgba(255,255,255,.82); }
.sales-switch-action {
  flex: 0 0 auto;
  border-color: rgba(255,255,255,.32) !important;
  color: #fff !important;
  background: rgba(255,255,255,.11) !important;
}

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

.sales-totals article {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15,76,129,.07);
}
.sales-totals span,
.sales-totals strong,
.sales-totals small { display: block; }
.sales-totals span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.sales-totals strong { margin: 8px 0 4px; color: #0f766e; font-size: 28px; line-height: 1.1; overflow-wrap: anywhere; }
.sales-totals small { color: var(--muted); }
.sales-month-status { font-size: 22px !important; }
.sales-month-status.closed { color: #b91c1c !important; }
.sales-month-status.open { color: #15803d !important; }

.sales-grid {
  display: grid;
  grid-template-columns: minmax(300px,.78fr) minmax(0,1.22fr);
  gap: 18px;
  align-items: start;
}

.sales-form {
  display: grid;
  gap: 15px;
}

.sales-category-fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.sales-category-fieldset legend {
  grid-column: 1 / -1;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}
.sales-category-option { cursor: pointer; }
.sales-category-option input { position: absolute; opacity: 0; pointer-events: none; }
.sales-category-option span {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 850;
}
.sales-category-option input:checked + span {
  border-color: #14b8a6;
  color: #115e59;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(20,184,166,.1);
}

.sales-month-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sales-month-actions input { min-width: 160px; }
.sales-list { display: grid; gap: 10px; }
.sales-item {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.sales-item-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ecfdf5;
  font-size: 20px;
}
.sales-item-copy { min-width: 0; }
.sales-item-copy strong,
.sales-item-copy small { display: block; }
.sales-item-copy strong { overflow-wrap: anywhere; }
.sales-item-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.sales-item-value { color: #0f766e; font-size: 17px; white-space: nowrap; }
.sales-empty {
  padding: 28px 18px;
  border: 1px dashed #b8d8d3;
  border-radius: 18px;
  color: #52706c;
  background: #f0fdfa;
  text-align: center;
}
.sales-empty strong,
.sales-empty span { display: block; }
.sales-empty span { margin-top: 4px; font-size: 12px; }

/* Splash simples e estável: 3 segundos sem elementos que vazam da tela. */
.app-intro-card {
  gap: 12px;
  animation: appIntroSimple 3s ease both;
}
.app-intro-brand {
  animation: appIntroBrandSimple 3s cubic-bezier(.22,.8,.25,1) both;
}
.app-intro-progress {
  width: 160px;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}
.app-intro-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,#fb923c,#fff7ed);
  transform-origin: left center;
  animation: appIntroProgress 2.7s linear both;
}
@keyframes appIntroSimple {
  0% { opacity: 0; transform: translateY(6px); }
  12%, 82% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes appIntroBrandSimple {
  0% { opacity: 0; transform: scale(.78); }
  18% { opacity: 1; transform: scale(1.04); }
  28%, 82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.96); }
}
@keyframes appIntroProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* O modal fica acima do cabeçalho, mas abaixo da navegação inferior. */
#editModal {
  z-index: 74;
}
#editModal .modal-card {
  position: relative;
}
#editModal .panel-header {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -4px -2px 8px;
  padding: 4px 2px 12px;
  background: #fff;
}
.edit-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 4px -2px -4px;
  padding: 12px 2px 4px;
  background: linear-gradient(180deg,rgba(255,255,255,0),#fff 22%);
}
.edit-sticky-actions .btn { width: 100%; }

@media (max-width: 1000px) {
  .sales-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Correção prioritária Redmi/Android: a página inteira rola com um dedo. */
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-menu-open,
  body.modal-open,
  body.action-loading,
  body.page-area-loading,
  body.intro-open {
    overflow: hidden !important;
  }

  .app,
  .main,
  .page,
  .panel,
  .wide-panel,
  #page-registros,
  #page-registros .records-panel,
  .mobile-records-list,
  .mobile-delivery-card,
  .sales-shell,
  .sales-page {
    touch-action: pan-y !important;
    overscroll-behavior: auto !important;
  }

  button,
  a,
  input,
  textarea,
  select,
  label {
    touch-action: manipulation !important;
  }

  #signatureCanvas {
    touch-action: none !important;
  }

  .mobile-more-overlay,
  .mobile-more-overlay * {
    touch-action: pan-y !important;
  }
  .mobile-more-link,
  .mobile-sheet-close,
  .mobile-more-footer .btn {
    touch-action: manipulation !important;
  }

  .photo-capture-card {
    grid-template-columns: 1fr;
  }
  .photo-source-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .camera-button,
  .gallery-button {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
  }

  .desktop-system-switch { display: none; }

  body[data-active-page="vendas"] .mobile-bottom-nav {
    display: none !important;
  }
  body[data-active-page="vendas"] .main {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .sales-hero {
    display: grid;
    padding: 20px;
    border-radius: 22px;
  }
  .sales-hero h3 { font-size: 24px; }
  .sales-switch-action { width: 100%; }
  .sales-totals { grid-template-columns: 1fr 1fr; gap: 9px; }
  .sales-totals article { padding: 15px; border-radius: 17px; }
  .sales-totals article:nth-child(3) { grid-column: 1 / -1; }
  .sales-totals strong { font-size: 23px; }
  .sales-grid { gap: 13px; }
  .sales-entry-panel,
  .sales-history-panel { padding: 16px; border-radius: 20px; }
  .sales-month-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .sales-month-actions input { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .sales-item { grid-template-columns: auto minmax(0,1fr); }
  .sales-item-value { grid-column: 2; justify-self: start; }

  #editModal {
    align-items: flex-end;
    padding: 0 0 calc(74px + env(safe-area-inset-bottom));
  }
  #editModal .modal-card {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 74px - env(safe-area-inset-bottom));
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y !important;
    border-radius: 24px 24px 0 0;
    padding: 18px 16px 16px;
  }
  #editModal .panel-header {
    padding-top: 4px;
  }
  #editForm {
    padding-bottom: 2px;
  }
  .edit-sticky-actions {
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .sales-totals { grid-template-columns: 1fr; }
  .sales-totals article:nth-child(3) { grid-column: auto; }
  .sales-category-fieldset { grid-template-columns: 1fr 1fr; }
  .photo-source-actions { grid-template-columns: 1fr; }
}

/* V40.13 - comprovante estável, plano pago visível e relatório de vendas */
.subscription-home.premium-plans.paid {
  position: relative;
  min-height: 126px;
  border: 1px solid #a7d9bd !important;
  background: linear-gradient(135deg, #f3fff8, #ffffff) !important;
  box-shadow: 0 18px 42px rgba(22, 106, 50, .12) !important;
}

.subscription-home.premium-plans.paid::after {
  content: "✓";
  position: absolute;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #176a32;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(23, 106, 50, .22);
}

.subscription-home.premium-plans.paid #subscriptionTitle {
  color: #176a32 !important;
}

.subscription-home.premium-plans.paid #subscriptionText {
  max-width: 680px;
  color: #3f6650 !important;
}

.sales-hero-actions {
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  min-width: 220px;
}

.sales-values-toggle {
  border-color: rgba(255,255,255,.32) !important;
  color: #fff !important;
  background: rgba(255,255,255,.17) !important;
}

.sales-values-toggle.is-hidden-mode {
  background: rgba(7, 49, 54, .34) !important;
}

.sales-values-hidden .sales-item-value,
.sales-values-hidden .sales-totals strong:not(.sales-month-status) {
  letter-spacing: .03em;
}

.sales-submit-shine {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
  box-shadow: 0 14px 30px rgba(15, 118, 110, .24);
}

.sales-submit-shine span {
  position: relative;
  z-index: 2;
}

.sales-submit-shine::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -55%;
  z-index: 1;
  width: 38%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  animation: salesButtonShine 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes salesButtonShine {
  0%, 28% { left: -55%; opacity: 0; }
  38% { opacity: 1; }
  62% { left: 120%; opacity: .9; }
  63%, 100% { left: 120%; opacity: 0; }
}

.sales-report-document {
  overflow: hidden;
}

.sales-report-cover {
  background:
    radial-gradient(circle at 90% 10%, rgba(20,184,166,.12), transparent 28%),
    linear-gradient(180deg, #f8fffd, #fff);
}

.sales-report-stamp {
  border-color: #99d8cf;
  color: #115e59;
  background: #ecfdf5;
}

.sales-report-summary > div {
  border-color: #ccebe5;
  background: #f0fdfa;
}

.sales-report-summary strong,
.sales-report-total-footer strong {
  color: #0f766e;
}

.sales-report-total-footer {
  min-width: 230px;
  padding: 16px 18px;
  border: 1px solid #a7ddd5;
  border-radius: 16px;
  text-align: right;
  background: #f0fdfa;
}

.sales-report-total-footer span,
.sales-report-total-footer strong {
  display: block;
}

.sales-report-total-footer span {
  color: #52706c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
}

.sales-report-total-footer strong {
  margin-top: 4px;
  font-size: 25px;
}

/* Comprovante sem assinatura: uma única área vertical rolável e sem largura excedente. */
#proofModal {
  z-index: 92;
  align-items: center;
  justify-items: center;
  padding: 12px;
  overflow: hidden;
  overscroll-behavior: contain;
}

#proofModal .proof-modal-card {
  width: min(620px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
}

#proofModal .proof-modal-header {
  position: relative;
  z-index: 3;
  min-width: 0;
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

#proofModal .proof-modal-header > div {
  min-width: 0;
}

#proofModal .proof-modal-header h3,
#proofModal .proof-modal-header p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

#proofModal #proofForm {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

#proofModal #proofForm,
#proofModal #proofForm label,
#proofModal #proofForm .form-grid-2,
#proofModal #proofForm .proof-photo-source,
#proofModal #proofForm .proof-photo-preview,
#proofModal #proofForm .receipt-code {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#proofModal input,
#proofModal select,
#proofModal button,
#proofModal label {
  max-width: 100%;
  touch-action: manipulation !important;
}

#proofModal .proof-photo-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;
  background: #f5f7fa;
}

#proofModal .proof-photo-preview.hidden {
  display: none !important;
}

#proofModal .proof-photo-preview img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 11px;
  background: #eef1f5;
}

#proofModal .proof-photo-preview .btn {
  position: absolute;
  right: 28px;
  bottom: 82px;
  width: auto;
  min-width: 132px;
}

#proofModal .proof-submit-actions {
  position: sticky;
  bottom: -1px;
  z-index: 5;
  margin: 2px -2px -2px;
  padding: 14px 2px 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}

#proofModal .proof-submit-actions .btn {
  width: 100%;
}

body.sales-system-active .mobile-bottom-nav {
  display: none !important;
}

body.sales-system-active .main {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

body.printing-sales-report #supportFloat,
body.printing-sales-report .support-float,
body.printing-sales-report .sidebar,
body.printing-sales-report .topbar,
body.printing-sales-report .mobile-app-header,
body.printing-sales-report .mobile-bottom-nav,
body.printing-sales-report #alertBox,
body.printing-sales-report .loading-overlay,
body.printing-sales-report .payment-modal,
body.printing-sales-report .no-print {
  display: none !important;
}

body.printing-sales-report .main {
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  .sales-hero-actions {
    width: 100%;
    min-width: 0;
  }

  .sales-month-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  #salesReportBtn,
  #salesCloseMonthBtn {
    width: 100%;
  }

  .sales-report-document {
    padding: 15px;
  }

  .sales-report-toolbar .filter-row {
    width: 100%;
  }

  .sales-report-footer {
    display: grid;
  }

  .sales-report-total-footer {
    min-width: 0;
    text-align: left;
  }

  #proofModal {
    align-items: center !important;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)) !important;
  }

  #proofModal .proof-modal-card {
    width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
    border-radius: 22px;
  }

  #proofModal .proof-modal-header {
    align-items: flex-start;
    flex-direction: row;
    gap: 10px;
    padding: 15px 14px 12px;
  }

  #proofModal .proof-modal-header .btn {
    width: auto;
    flex: 0 0 auto;
  }

  #proofModal #proofForm {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }

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

  #proofModal .proof-photo-preview .btn {
    right: 22px;
    bottom: 82px;
  }
}

@media (max-width: 430px) {
  .sales-report-category-table,
  .sales-report-detail-table {
    overflow-x: auto;
  }

  .sales-report-category-table table,
  .sales-report-detail-table table {
    min-width: 620px;
  }

  #proofModal .proof-modal-header h3 {
    font-size: 21px;
  }

  #proofModal .proof-modal-header p {
    font-size: 12px;
    line-height: 1.35;
  }
}

@media print {
  body.printing-sales-report .app,
  body.printing-sales-report .main,
  body.printing-sales-report #page-vendas-relatorio,
  body.printing-sales-report #salesReportPrintArea {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }

  body.printing-sales-report .page:not(#page-vendas-relatorio) {
    display: none !important;
  }

  body.printing-sales-report #salesReportPrintArea {
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.printing-sales-report .sales-report-total-footer {
    border-color: #999;
  }
}
#proofModal .proof-photo-preview { position: relative; }
.subscription-home.premium-plans.paid {
  grid-template-columns: minmax(0, 1fr) !important;
  padding-right: 82px !important;
}
#proofModal .proof-photo-preview {
  aspect-ratio: auto;
  display: block;
  overflow: hidden;
}

#proofModal .proof-photo-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: #eef1f5;
}

#proofModal .proof-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#proofModal .proof-photo-preview .btn {
  position: static;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}

/* V40.16 - seleção de secretaria, contexto de vendas, relatório legível e plano */
.system-context-hidden {
  display: none !important;
}

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

.field-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.secretaria-picker-trigger {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 76, 129, .06);
}

.secretaria-picker-trigger:focus-visible,
.secretaria-picker-trigger.has-selection {
  outline: none;
  border-color: #d6a653;
  box-shadow: 0 0 0 3px rgba(197,148,69,.13), 0 10px 24px rgba(15,76,129,.07);
}

.secretaria-picker-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #d9ae64, #a9772f);
  font-size: 20px;
  font-weight: 950;
}

.secretaria-picker-copy,
.secretaria-picker-copy small,
.secretaria-picker-copy strong {
  min-width: 0;
  display: block;
}

.secretaria-picker-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.secretaria-picker-copy strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.secretaria-picker-arrow {
  color: #9a7b46;
  font-size: 27px;
  line-height: 1;
}

.delivery-type-card {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #b9dec9;
  border-radius: 16px;
  background: #f2fbf6;
}

.delivery-type-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: #176a32;
  font-weight: 950;
}

.delivery-type-card small,
.delivery-type-card strong {
  display: block;
}

.delivery-type-card small {
  color: #557463;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.delivery-type-card strong {
  margin-top: 2px;
  color: #176a32;
  font-size: 16px;
}

.secretaria-picker-modal {
  z-index: 120;
}

.secretaria-picker-card {
  width: min(520px, 100%);
  max-height: min(720px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}

.secretaria-picker-header {
  margin: 0;
}

.secretaria-picker-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.secretaria-picker-list {
  min-height: 90px;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.secretaria-picker-option {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: #fff;
  text-align: left;
  font-weight: 850;
  cursor: pointer;
}

.secretaria-picker-option > span:last-child {
  overflow-wrap: anywhere;
}

.secretaria-picker-option.selected {
  border-color: #d4ad69;
  background: #fffaf1;
  box-shadow: 0 8px 20px rgba(169,119,47,.10);
}

.secretaria-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid #cfd6df;
  border-radius: 7px;
  color: #fff;
  background: #fff;
  font-size: 15px;
  font-weight: 950;
}

.secretaria-picker-option.selected .secretaria-check {
  border-color: #b48336;
  background: #b48336;
}

.secretaria-picker-empty,
.sales-report-empty {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 20px;
  border: 1px dashed #ccd5df;
  border-radius: 16px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
}

.secretaria-picker-empty strong,
.sales-report-empty strong {
  color: var(--text);
}

/* Relatório particular: leitura completa no celular e impressão organizada. */
.sales-report-document,
.sales-report-document * {
  min-width: 0;
}

.sales-report-document .report-meta strong,
.sales-report-document td,
.sales-report-document th {
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.sales-report-category-cards {
  display: none;
}

.sales-report-mobile-list {
  display: none;
}

.sales-report-detail-table th:nth-child(4),
.sales-report-detail-table td:nth-child(4) {
  width: 42%;
  text-align: left;
}

.sales-report-category-table table,
.sales-report-detail-table table {
  table-layout: auto;
}

/* O plano a pagar fica vermelho e totalmente legível. */
.subscription-home.premium-plans:not(.paid) .plan-monthly-btn,
.subscription-home.premium-plans:not(.paid) .plan-monthly-btn:hover,
.subscription-home.premium-plans:not(.paid) .plan-monthly-btn:focus-visible {
  border-color: #a82222 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #d53232, #a91616) !important;
  box-shadow: 0 14px 28px rgba(177, 25, 25, .24) !important;
  opacity: 1 !important;
}

.subscription-home.premium-plans:not(.paid) .plan-monthly-btn small,
.subscription-home.premium-plans:not(.paid) .plan-monthly-btn strong,
.subscription-home.premium-plans:not(.paid) .plan-monthly-btn span {
  color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.14);
}

/* Pago: cartão azul, sem aparência de cobrança pendente. */
.subscription-home.premium-plans.paid {
  border-color: #9fc2eb !important;
  background: linear-gradient(135deg, #eef6ff, #ffffff) !important;
  box-shadow: 0 18px 42px rgba(15, 76, 129, .13) !important;
}

.subscription-home.premium-plans.paid::after {
  background: #0f4c81 !important;
  box-shadow: 0 10px 24px rgba(15,76,129,.24) !important;
}

.subscription-home.premium-plans.paid #subscriptionTitle,
.subscription-pill.ok {
  color: #0f4c81 !important;
}

.subscription-home.premium-plans.paid #subscriptionText {
  color: #45647f !important;
}

.subscription-pill.ok {
  border-color: #bad3ec;
  background: #eef6ff;
}

@media (max-width: 900px) {
  .secretaria-picker-modal {
    align-items: flex-end;
    padding: 0;
  }

  .secretaria-picker-card {
    width: 100%;
    max-width: none;
    max-height: calc(88dvh - env(safe-area-inset-top));
    margin: 0;
    padding: 18px 15px calc(16px + env(safe-area-inset-bottom));
    border-radius: 25px 25px 0 0;
  }

  .secretaria-picker-header {
    align-items: flex-start;
    flex-direction: row;
    gap: 10px;
  }

  .secretaria-picker-header .btn {
    width: auto;
    flex: 0 0 auto;
  }

  /* A navegação inferior permanece disponível dentro das vendas e do relatório. */
  body.sales-system-active .mobile-bottom-nav,
  body[data-active-page="vendas"] .mobile-bottom-nav,
  body[data-active-page="vendas-relatorio"] .mobile-bottom-nav,
  body[data-active-page="config"].sales-system-active .mobile-bottom-nav {
    display: flex !important;
  }

  body.sales-system-active .main,
  body[data-active-page="vendas"] .main,
  body[data-active-page="vendas-relatorio"] .main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .sales-report-document {
    width: 100%;
    max-width: 100%;
    padding: 13px !important;
    overflow: hidden;
  }

  .sales-report-cover {
    padding: 16px;
    border-radius: 18px;
  }

  .sales-report-cover .report-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
  }

  .sales-report-cover .report-document-stamp {
    grid-column: 1 / -1;
    width: 100%;
    text-align: left;
  }

  .sales-report-cover .report-brand-copy h3 {
    font-size: 22px;
    line-height: 1.12;
  }

  .sales-report-cover .report-brand-copy p {
    font-size: 12px;
    line-height: 1.4;
  }

  .sales-report-document .report-meta {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sales-report-document .report-meta > div {
    padding: 11px;
  }

  .sales-report-document .report-meta strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .sales-report-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sales-report-summary > div {
    padding: 13px 11px;
  }

  .sales-report-summary strong {
    font-size: 20px;
    line-height: 1.15;
  }

  .sales-report-category-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .sales-category-report-card {
    display: grid;
    grid-template-columns: 46px minmax(0,1fr);
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid #ccebe5;
    border-radius: 16px;
    background: #f5fffc;
  }

  .sales-category-report-card.drink {
    border-color: #cfe0f3;
    background: #f5f9ff;
  }

  .sales-category-report-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    font-size: 23px;
  }

  .sales-category-report-card small,
  .sales-category-report-card strong,
  .sales-category-report-card span {
    display: block;
  }

  .sales-category-report-card small {
    color: var(--muted);
    font-weight: 800;
  }

  .sales-category-report-card strong {
    margin-top: 1px;
    color: #0f766e;
    font-size: 21px;
  }

  .sales-category-report-card span:last-child {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
  }

  .sales-report-mobile-list {
    display: grid;
    gap: 9px;
  }

  .sales-report-mobile-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }

  .sales-report-mobile-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #0f766e;
    background: #e8faf6;
    font-size: 12px;
    font-weight: 950;
  }

  .sales-report-mobile-copy,
  .sales-report-mobile-topline {
    min-width: 0;
  }

  .sales-report-mobile-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .sales-report-mobile-topline > strong {
    flex: 0 0 auto;
    color: #0f766e;
    font-size: 16px;
  }

  .sales-report-category-tag {
    display: inline-flex;
    max-width: 56%;
    padding: 4px 8px;
    border-radius: 999px;
    color: #0f766e;
    background: #e8faf6;
    font-size: 10px;
    font-weight: 900;
  }

  .sales-report-category-tag.bebida {
    color: #0f4c81;
    background: #eaf3ff;
  }

  .sales-report-mobile-copy h4 {
    margin: 8px 0 3px;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.35;
  }

  .sales-report-mobile-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
  }

  .desktop-report-table {
    display: none;
  }

  .sales-report-footer {
    gap: 12px;
  }
}

@media (max-width: 430px) {
  .sales-report-document .report-meta,
  .sales-report-summary {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sales-report-category-cards,
  .sales-report-mobile-list {
    display: none !important;
  }

  .desktop-report-table {
    display: block !important;
    overflow: visible !important;
  }

  .sales-report-detail-table th:nth-child(4),
  .sales-report-detail-table td:nth-child(4) {
    width: 45%;
    white-space: normal !important;
  }
}

.subscription-home.premium-plans .home-plan-actions.paid-hidden { display: none !important; }

/* V40.17 - correções finais de secretaria, saída, splash e relatório de vendas */
#secretariasList {
  display: none !important;
}

.delivery-type-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  padding: 12px 14px;
  overflow: hidden;
}

.delivery-type-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  background: #e8f7ee;
  color: #176a32;
  box-shadow: inset 0 0 0 1px rgba(23,106,50,.14);
}

.delivery-type-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delivery-type-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
}

.delivery-type-copy small,
.delivery-type-copy strong {
  display: block;
  margin: 0 !important;
  line-height: 1.15;
}

.delivery-type-copy small {
  font-size: 11px;
  letter-spacing: .07em;
}

.delivery-type-copy strong {
  font-size: 18px;
}

.app-intro-credit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.16);
  display: grid;
  gap: 3px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height: 1.25;
}

.app-intro-credit span,
.app-intro-credit strong,
.app-intro-credit small {
  display: block;
  margin: 0;
  max-width: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

.app-intro-credit strong {
  display: inline;
  font-weight: 900;
}

.app-intro-credit small {
  color: rgba(255,255,255,.65);
  font-size: 11px;
}

@media (max-width: 900px) {
  .delivery-type-card {
    min-height: 72px;
  }

  .sales-report-toolbar .filter-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  #salesReportPrintBtn,
  #salesReportBackBtn {
    width: 100%;
  }
}

/* V40.18 — rodapé proporcional nas vendas e solicitações de atualização */
@media (max-width: 900px) {
  body.sales-system-active .mobile-bottom-nav,
  body[data-active-page="vendas"] .mobile-bottom-nav,
  body[data-active-page="vendas-relatorio"] .mobile-bottom-nav,
  body[data-active-page="config"].sales-system-active .mobile-bottom-nav,
  body[data-active-page="atualizacoes"].sales-system-active .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-content: stretch !important;
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
  }

  body.sales-system-active .mobile-bottom-nav .mobile-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-inline: 0 !important;
    justify-self: stretch !important;
    text-align: center;
  }
}

.update-plan-callout,
.update-request-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.update-request-shell {
  display: grid;
  gap: 18px;
}

.update-request-hero {
  padding: 26px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 10%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(135deg, #9a3412, #ea580c);
  box-shadow: 0 18px 42px rgba(154,52,18,.2);
}

.update-request-hero .eyebrow { color: #ffedd5; }
.update-request-hero h3 { margin: 4px 0 7px; font-size: 28px; }
.update-request-hero p { margin: 0; color: rgba(255,255,255,.84); }

.update-price-badge {
  flex: 0 0 auto;
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px;
  background: rgba(255,255,255,.12);
  text-align: center;
}
.update-price-badge small,
.update-price-badge strong { display: block; }
.update-price-badge small { color: rgba(255,255,255,.78); }
.update-price-badge strong { margin-top: 5px; font-size: 22px; }

.update-plan-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.update-plan-summary article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15,76,129,.07);
}
.update-plan-summary span,
.update-plan-summary strong,
.update-plan-summary small { display: block; }
.update-plan-summary span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.update-plan-summary strong { margin: 7px 0 3px; color: #c2410c; font-size: 27px; overflow-wrap: anywhere; }
.update-plan-summary small { color: var(--muted); }

.update-request-columns { align-items: start; }
.update-requests-list { display: grid; gap: 11px; }
.update-request-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.update-request-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.update-request-item h4 { margin: 2px 0 4px; font-size: 17px; overflow-wrap: anywhere; }
.update-request-item p { margin: 10px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.update-request-item small { color: var(--muted); }
.update-request-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #fff7ed;
  color: #c2410c;
}
.update-request-status.entregue { background: #dcfce7; color: #166534; }
.update-request-status.cancelada { background: #fee2e2; color: #991b1b; }
.update-request-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .update-plan-callout,
  .update-request-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .update-plan-callout .btn { width: 100%; }
  .update-price-badge { width: 100%; min-width: 0; }
  .update-plan-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .update-plan-summary article { padding: 15px; border-radius: 17px; }
  .update-plan-summary article:nth-child(3) { grid-column: 1 / -1; }
  .update-plan-summary strong { font-size: 23px; }
  .update-request-item-head { gap: 8px; }
}


/* Lançamento retroativo de saídas — somente hoje ou datas anteriores */
.retroactive-date-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 17px;
  border: 1px solid #d8e4f0;
  border-radius: 19px;
  background: linear-gradient(135deg, #f7fbff, #fff);
}

.retroactive-date-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.retroactive-date-head > div { min-width: 0; flex: 1; }
.retroactive-date-head strong,
.retroactive-date-head small { display: block; }
.retroactive-date-head strong { color: var(--blue-dark); font-size: 15px; }
.retroactive-date-head small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.retroactive-date-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}
.retroactive-date-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.retroactive-date-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e7f4ed;
  color: #176a32;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.retroactive-date-status.retroactive { background: #fff1e5; color: #9a3412; }

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

@media (max-width: 640px) {
  .retroactive-date-card { padding: 14px; border-radius: 17px; }
  .retroactive-date-head { align-items: flex-start; flex-wrap: wrap; }
  .retroactive-date-status { margin-left: 54px; margin-top: -6px; }
  .retroactive-date-fields { grid-template-columns: 1fr; gap: 10px; }
}

/* V40.20 — Contratos particulares por CPF */
.contracts-page,
.contracts-shell,
.contracts-workspace,
.contracts-layout,
.contract-clients-panel,
.contract-consumption-panel,
.contract-history-panel {
  min-width: 0;
  max-width: 100%;
}

.contracts-shell {
  display: grid;
  gap: 18px;
}

.contracts-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #172334, #26384a);
  color: #fff;
  box-shadow: 0 18px 46px rgba(16, 30, 47, .16);
}

.contracts-hero .eyebrow { color: #ffd29d; }
.contracts-hero h3 { margin: 4px 0 6px; font-size: 29px; }
.contracts-hero p { margin: 0; color: rgba(255,255,255,.78); max-width: 720px; }
.contracts-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.contracts-hero-actions .btn { width: auto; }
.contracts-back-btn { background: #fff; color: #172334; border-color: #fff; }

.contracts-top-summary,
.contract-month-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contracts-top-summary article,
.contract-month-summary article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 76, 129, .06);
  min-width: 0;
}

.contracts-top-summary span,
.contracts-top-summary strong,
.contracts-top-summary small,
.contract-month-summary span,
.contract-month-summary strong { display: block; }
.contracts-top-summary span,
.contract-month-summary span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.contracts-top-summary strong,
.contract-month-summary strong { margin-top: 7px; color: #172334; font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.contracts-top-summary small { margin-top: 5px; color: var(--muted); }
.contracts-guidance { background: linear-gradient(135deg, #fff8ef, #fff) !important; border-color: #f3d4ae !important; }
.contracts-guidance strong { color: #c26713; }

.contracts-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.contract-clients-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
}

.contract-search-label { display: grid; gap: 7px; font-weight: 850; }
.contract-clients-list { display: grid; gap: 8px; max-height: 470px; overflow-y: auto; padding-right: 2px; }
.contract-client-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: .18s ease;
}
.contract-client-card:hover,
.contract-client-card.active { border-color: #f0a259; box-shadow: 0 9px 22px rgba(245,130,32,.12); }
.contract-client-card.active { background: #fff8ef; }
.contract-client-avatar {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #fff0df; color: #b65f12; font-weight: 950; flex: 0 0 auto;
}
.contract-client-avatar.large { width: 54px; height: 54px; border-radius: 18px; font-size: 16px; }
.contract-client-copy { min-width: 0; }
.contract-client-copy strong,
.contract-client-copy small { display: block; }
.contract-client-copy strong { overflow-wrap: anywhere; }
.contract-client-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.contract-client-status { font-size: 10px; font-weight: 900; border-radius: 999px; padding: 6px 8px; white-space: nowrap; }
.contract-client-status.active { background: #e7f4ed; color: #176a32; }
.contract-client-status.inactive { background: #f1f2f5; color: #687382; }

.contract-new-client { border-top: 1px solid var(--line); padding-top: 12px; }
.contract-new-client summary { cursor: pointer; font-weight: 900; color: var(--blue-dark); padding: 7px 0; }
.contract-client-form { margin-top: 10px; }
.contract-client-form small { color: var(--muted); font-weight: 600; }

.contracts-workspace { display: grid; gap: 14px; }
.contract-no-selection { min-height: 300px; display: grid; place-items: center; align-content: center; text-align: center; padding: 36px; }
.contract-no-selection p { max-width: 480px; margin: 7px auto 0; color: var(--muted); }
.contract-empty-icon { font-size: 40px; margin-bottom: 9px; }

#contractSelectedArea { display: grid; gap: 14px; }
.contract-client-header-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.contract-client-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contract-client-identity h3 { margin: 3px 0 3px; }
.contract-client-identity p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.contract-month-picker { display: flex; align-items: end; gap: 8px; }
.contract-month-picker label { display: grid; gap: 6px; font-weight: 850; }
.contract-month-picker .btn { width: auto; }

.contract-month-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.contract-month-summary strong { font-size: 18px; }
.contract-status.aberto { color: #b36b14; }
.contract-status.fechado { color: #0f4c81; }
.contract-status.pago { color: #176a32; }

.contract-consumption-form { display: grid; gap: 14px; }
.contract-type-fieldset {
  margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px;
}
.contract-type-fieldset legend { grid-column: 1 / -1; margin-bottom: 2px; font-weight: 900; }
.contract-type-fieldset label { cursor: pointer; }
.contract-type-fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.contract-type-fieldset span {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px;
  border: 1px solid var(--line); border-radius: 15px; background: #fff; font-weight: 900; text-align: center;
}
.contract-type-fieldset input:checked + span { border-color: #f58220; background: #fff2e4; color: #9b4b0a; box-shadow: inset 0 0 0 1px #f58220; }
.contract-description-field { display: grid; gap: 7px; font-weight: 850; }
.contract-value-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) minmax(150px, .8fr); gap: 10px; align-items: end; }
.contract-value-grid label,
.contract-date-grid label { display: grid; gap: 7px; font-weight: 850; }
.contract-calculated-total { min-height: 52px; padding: 9px 13px; border-radius: 15px; background: #172334; color: #fff; display: grid; align-content: center; }
.contract-calculated-total span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.68); font-weight: 900; }
.contract-calculated-total strong { font-size: 19px; }
.contract-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.contract-history-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.contract-history-actions .btn { width: auto; }
.success-btn { background: #176a32; color: #fff; border-color: #176a32; }
.contract-history-list { display: grid; gap: 9px; }
.contract-consumption-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: center;
  border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff;
}
.contract-consumption-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: #fff1e5; }
.contract-consumption-copy { min-width: 0; }
.contract-consumption-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.contract-consumption-top strong { overflow-wrap: anywhere; }
.contract-consumption-top span { color: #0f766e; font-weight: 950; white-space: nowrap; }
.contract-consumption-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.contract-empty { border: 1px dashed #cfd6df; background: #f8fafc; border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); }
.contract-empty strong,
.contract-empty span { display: block; }
.contract-empty strong { color: var(--text); }
.contract-empty span { margin-top: 4px; font-size: 12px; }

@media (max-width: 1100px) {
  .contracts-layout { grid-template-columns: 1fr; }
  .contract-clients-panel { position: relative; top: auto; }
  .contract-clients-list { max-height: 320px; }
}

@media (max-width: 900px) {
  body.contracts-system-active .mobile-bottom-nav,
  body[data-active-page="contratos"] .mobile-bottom-nav,
  body[data-active-page="config"].contracts-system-active .mobile-bottom-nav,
  body[data-active-page="atualizacoes"].contracts-system-active .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-content: stretch !important;
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
  }

  body.contracts-system-active .mobile-bottom-nav .mobile-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-inline: 0 !important;
    justify-self: stretch !important;
    text-align: center;
  }

  body.contracts-system-active .main,
  body[data-active-page="contratos"] .main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .contracts-hero { padding: 18px; border-radius: 20px; flex-direction: column; align-items: stretch; }
  .contracts-hero h3 { font-size: 24px; }
  .contracts-hero-actions { display: grid; grid-template-columns: 1fr; }
  .contracts-hero-actions .btn { width: 100%; }
  .contracts-top-summary { grid-template-columns: 1fr 1fr; }
  .contracts-guidance { grid-column: 1 / -1; }
  .contracts-layout { gap: 12px; }
  .contract-clients-panel,
  .contract-consumption-panel,
  .contract-history-panel,
  .contract-client-header-card { padding: 15px; border-radius: 19px; }
  .contract-client-header-card { display: grid; }
  .contract-month-picker { display: grid; grid-template-columns: 1fr auto; }
  .contract-month-picker .btn { align-self: end; }
  .contract-month-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .contract-month-summary article { padding: 13px; border-radius: 16px; }
  .contract-month-summary strong { font-size: 16px; }
  .contract-type-fieldset { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .contract-type-fieldset span { min-height: 48px; padding: 8px 6px; font-size: 12px; }
  .contract-value-grid { grid-template-columns: 1fr 1fr; }
  .contract-calculated-total { grid-column: 1 / -1; }
  .contract-date-grid { grid-template-columns: 1fr 1fr; }
  .contract-history-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .contract-history-actions .btn { width: 100%; }
  #contractPdfBtn { grid-column: 1 / -1; }
  .contract-consumption-top { gap: 7px; }
}

@media (max-width: 520px) {
  .contracts-top-summary { grid-template-columns: 1fr; }
  .contracts-guidance { grid-column: auto; }
  .contract-month-summary { grid-template-columns: 1fr 1fr; }
  .contract-type-fieldset { grid-template-columns: 1fr; }
  .contract-value-grid,
  .contract-date-grid { grid-template-columns: 1fr; }
  .contract-calculated-total { grid-column: auto; }
  .contract-history-actions { grid-template-columns: 1fr; }
  #contractPdfBtn { grid-column: auto; }
  .contract-consumption-top { display: grid; }
  .contract-consumption-top span { white-space: normal; }
}


/* V40.21 — Contratos particulares reorganizados para celular */
.contracts-hero-compact { padding: 20px 22px; }
.contracts-hero-compact h3,
.contracts-hero-compact strong,
.contracts-hero-compact p { color: #fff; }
.contracts-hero-compact .eyebrow { color: #ffd29d; }

.contracts-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.contracts-section-tab {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: #172334;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 76, 129, .05);
}
.contracts-section-tab span { font-size: 18px; }
.contracts-section-tab strong { color: #172334; font-size: 13px; }
.contracts-section-tab.active {
  border-color: #f58220;
  background: #fff3e7;
  box-shadow: inset 0 0 0 1px #f58220, 0 8px 22px rgba(245,130,32,.09);
}
.contracts-section-tab.active strong { color: #9b4b0a; }

.contracts-view { min-width: 0; }
.contract-quick-panel,
.contract-clients-page-panel,
.contract-monthly-report-panel { max-width: 980px; margin: 0 auto; }
.contract-quick-form { display: grid; gap: 16px; }
.contract-quick-form label { display: grid; gap: 7px; font-weight: 850; }
.contract-quick-client select { min-height: 52px; }
.contract-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contract-quick-note { margin: -2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.contract-client-form-separated { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 20px; }
.contract-client-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contract-client-form-grid label { display: grid; gap: 7px; }
.contract-client-form-separated > .btn { width: auto; justify-self: start; }
.contract-client-directory { display: grid; gap: 13px; }
.contract-client-directory-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.contract-client-count-badge { border-radius: 999px; background: #f4f7fa; border: 1px solid var(--line); padding: 7px 11px; color: #526171; font-size: 12px; }
.contract-client-count-badge b { color: #172334; }
.contract-clients-page-panel .contract-clients-list { max-height: none; }

.contract-monthly-report-panel { overflow: hidden; }
.contract-report-head {
  margin: -24px -24px 18px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #172334, #26384a);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}
.contract-report-head .eyebrow { color: #ffd29d; }
.contract-report-head h3,
.contract-report-head p,
.contract-report-head label,
.contract-report-head strong { color: #fff !important; }
.contract-report-head h3 { margin: 4px 0 5px; }
.contract-report-head p { margin: 0; opacity: .82; }
.contract-report-month-picker { display: flex; align-items: end; gap: 8px; min-width: 280px; }
.contract-report-month-picker label { display: grid; gap: 6px; flex: 1; }
.contract-report-month-picker input { background: #fff; color: #172334; }
.contracts-report-refresh { background: #fff; color: #172334; border-color: #fff; width: auto; }

.contract-report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.contract-report-summary article { border: 1px solid var(--line); border-radius: 17px; padding: 14px; background: #f8fafc; }
.contract-report-summary span { display: block; color: #647284; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 900; }
.contract-report-summary strong { display: block; margin-top: 5px; color: #172334; font-size: 20px; }
.contract-monthly-clients-list { display: grid; gap: 9px; }
.contract-monthly-client-card {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 17px; padding: 12px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; text-align: left; cursor: pointer;
}
.contract-monthly-client-card:hover { border-color: #f0a259; background: #fffaf5; }
.contract-monthly-client-copy { min-width: 0; }
.contract-monthly-client-copy strong,
.contract-monthly-client-copy small,
.contract-monthly-client-total strong,
.contract-monthly-client-total small { display: block; }
.contract-monthly-client-copy strong { color: #172334; overflow-wrap: anywhere; }
.contract-monthly-client-copy small { margin-top: 3px; color: #6b7786; font-size: 11px; }
.contract-monthly-client-total { text-align: right; }
.contract-monthly-client-total strong { color: #0f766e; font-size: 15px; }
.contract-monthly-client-total small { margin-top: 3px; color: #6b7786; font-size: 10px; }
.contract-report-empty-selection { margin: 12px auto 0; max-width: 980px; min-height: 180px; }
.contract-report-detail { max-width: 980px; margin: 12px auto 0; display: grid; gap: 12px; }
.contract-report-detail.hidden { display: none !important; }
.contract-report-history-head h3,
.contract-report-history-head strong { color: var(--blue-dark) !important; }

@media (max-width: 900px) {
  .contracts-shell { gap: 12px; }
  .contracts-hero-compact { padding: 16px; }
  .contracts-hero-compact p { font-size: 12px; }
  .contracts-section-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .contracts-section-tab { min-height: 58px; padding: 8px 6px; display: grid; place-items: center; align-content: center; gap: 3px; }
  .contracts-section-tab span { font-size: 17px; line-height: 1; }
  .contracts-section-tab strong { font-size: 10px; line-height: 1.15; text-align: center; }
  .contract-quick-panel,
  .contract-clients-page-panel,
  .contract-monthly-report-panel { padding: 15px; border-radius: 19px; }
  .contract-quick-grid,
  .contract-client-form-grid { grid-template-columns: 1fr; }
  .contract-client-form-separated > .btn { width: 100%; }
  .contract-client-directory-head { align-items: center; }
  .contract-report-head { margin: -15px -15px 15px; padding: 17px 15px; display: grid; }
  .contract-report-month-picker { min-width: 0; width: 100%; }
  .contract-report-summary { grid-template-columns: 1fr 1fr; }
  .contract-report-summary article:first-child { grid-column: 1 / -1; }
  .contract-monthly-client-card { grid-template-columns: auto minmax(0, 1fr); }
  .contract-monthly-client-total { grid-column: 2; text-align: left; display: flex; align-items: center; gap: 7px; }
  .contract-monthly-client-total small { margin-top: 0; }
  .contract-report-detail .contract-client-header-card { padding: 15px; }
}

@media (max-width: 520px) {
  .contracts-hero-actions { grid-template-columns: 1fr 1fr; }
  .contracts-hero-actions .btn { min-width: 0; padding-inline: 8px; font-size: 11px; }
  .contract-report-summary { grid-template-columns: 1fr; }
  .contract-report-summary article:first-child { grid-column: auto; }
  .contract-report-month-picker { display: grid; grid-template-columns: 1fr auto; }
  .contract-client-directory-head { display: grid; }
  .contract-client-count-badge { justify-self: start; }
}


/* V40.22 — correções mobile de datas/relatório + ações de contratos */
.contract-report-month-picker,
.contract-report-month-picker label,
.contract-quick-date-grid,
.contract-quick-date-grid label,
.retroactive-date-fields,
.retroactive-date-fields label {
  min-width: 0;
  max-width: 100%;
}

.contract-report-month-picker input[type="month"],
.contract-quick-date-grid input[type="date"],
.contract-quick-date-grid input[type="time"],
.retroactive-date-fields input[type="date"],
.retroactive-date-fields input[type="time"] {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-min-logical-width: 0 !important;
}

.contract-monthly-client-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.contract-monthly-client-open {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
}
.contract-monthly-client-pdf {
  min-width: 64px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #fff6ed;
  color: #a64f0c;
  font-weight: 900 !important;
  padding: 10px;
  cursor: pointer;
}
.contract-monthly-client-pdf:active { background: #ffe7cf; }

.contract-consumption-item {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center;
}
.contract-consumption-delete {
  border: 1px solid #f3c6c6;
  background: #fff5f5;
  color: #a33a3a;
  border-radius: 12px;
  min-height: 40px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800 !important;
  cursor: pointer;
}
.contract-consumption-delete:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .contract-report-month-picker {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    width: 100% !important;
  }
  .contract-report-month-picker label { width: 100%; }
  .contracts-report-refresh {
    width: 100% !important;
    min-width: 0 !important;
  }

  .contract-quick-date-grid,
  .retroactive-date-fields {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    overflow: visible;
  }
  .contract-quick-date-grid > label,
  .retroactive-date-fields > label {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .retroactive-date-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  .contract-monthly-client-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .contract-monthly-client-open {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  .contract-monthly-client-total {
    grid-column: 2;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .contract-monthly-client-pdf {
    min-height: 44px;
    border-left: 0;
    border-top: 1px solid var(--line);
    width: 100%;
  }

  .contract-consumption-item {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  .contract-consumption-delete {
    grid-column: 2;
    justify-self: start;
    margin-top: 3px;
  }
}
