:root {
  --app-primary: #075985;
  --app-primary-strong: #0c4a6e;
  --app-primary-soft: #e0f2fe;
  --app-accent: #0284c7;
  --app-bg: #f1f5f9;
  --app-surface: #ffffff;
  --app-border: #dbe4ee;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-success: #15803d;
  --app-danger: #b91c1c;
  --app-warning: #a16207;
  --app-shadow: 0 12px 30px rgb(15 23 42 / 8%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  padding-top: 78px;
  background:
    radial-gradient(circle at top right, rgb(14 165 233 / 8%), transparent 31rem),
    var(--app-bg);
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select { min-height: 38px; }

.appbar {
  min-height: 70px;
  background: linear-gradient(115deg, var(--app-primary-strong), var(--app-primary));
}

.navbar-brand { line-height: 1.05; }
.brand-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgb(255 255 255 / 15%);
  font-size: 1.2rem;
}
.brand-subtitle { opacity: .76; font-size: .72rem; font-weight: 500; }

.app-wide {
  width: 100%;
  max-width: none;
}

main {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.hero-card {
  padding: 1.35rem 1.5rem;
  border: 1px solid rgb(2 132 199 / 18%);
  border-radius: 20px;
  background: linear-gradient(125deg, #fff, #f0f9ff);
  box-shadow: var(--app-shadow);
}

.eyebrow {
  margin-bottom: .45rem;
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-panel {
  min-width: min(100%, 310px);
  padding: .9rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: rgb(255 255 255 / 80%);
}
.status-label { color: var(--app-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }

.app-card {
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-card-header {
  min-height: 76px;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.section-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-right: .5rem;
  border-radius: 9px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 900;
}
.section-help { margin-top: .3rem; color: var(--app-muted); font-size: .82rem; }

.form-label {
  margin-bottom: .35rem;
  color: #334155;
  font-size: .79rem;
  font-weight: 700;
}

.form-control,
.form-select,
.input-group-text {
  border-color: #cbd5e1;
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 .22rem rgb(2 132 199 / 14%);
}

.calculation-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}
.calculation-strip > div {
  padding: .8rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #f8fafc;
}
.calculation-strip span { display: block; color: var(--app-muted); font-size: .72rem; font-weight: 700; }
.calculation-strip strong { display: block; margin-top: .15rem; color: var(--app-primary); font-size: .98rem; }

.component-card {
  padding: .9rem;
  border: 1px solid var(--app-border);
  border-radius: 13px;
  background: #fff;
}
.component-card .form-check-label { font-size: .76rem; }
.component-current {
  padding: .45rem .65rem;
  border-radius: 9px;
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
  font-size: .76rem;
  font-weight: 800;
}

.tip-box {
  display: flex;
  gap: .75rem;
  padding: .9rem;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: .82rem;
}
.tip-box > i { margin-top: .15rem; color: #f59e0b; }

.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.search-group { width: min(320px, 100%); }
.table-container { max-height: 64vh; min-height: 180px; }

.table {
  --bs-table-hover-bg: #f8fafc;
  font-size: .82rem;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-block: .82rem;
  border-bottom: 1px solid #cbd5e1;
  background: #eaf2f8;
  color: #334155;
  font-size: .69rem;
  letter-spacing: .025em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { padding-block: .68rem; border-color: #e2e8f0; vertical-align: middle; }
.table .description-col { min-width: 310px; }
.table .action-col { width: 42px; }
.table input[type="number"] { min-width: 92px; }
.table .form-control-sm { min-height: 32px; font-size: .78rem; }
.table-row-disabled { opacity: .48; background: #f8fafc; }
.table-row-locked { background: #fbfdff; }
.table-row-derived { background: #fffbeb; }

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #94a3b8;
  cursor: grab;
}
.drag-handle:hover { background: #e2e8f0; color: #475569; }
.drag-handle:active { cursor: grabbing; }
.drag-handle.is-disabled { cursor: not-allowed; opacity: .35; }
.sortable-ghost { opacity: .35; background: var(--app-primary-soft) !important; }

.formula-preview {
  max-width: 520px;
  color: var(--app-muted);
  font-size: .7rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.formula-preview span { display: block; }
.code-badge { min-width: 42px; }
.rule-badge { white-space: normal; text-align: left; font-size: .68rem; }

.value-positive { color: var(--app-success) !important; font-weight: 800; }
.value-negative { color: var(--app-danger) !important; font-weight: 800; }
.value-zero { color: var(--app-muted) !important; font-weight: 700; }

.empty-state {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .4rem;
  color: var(--app-muted);
  text-align: center;
}
.empty-state i { font-size: 2rem; color: #94a3b8; }

.summary-card {
  min-height: 110px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--app-border);
  border-radius: 15px;
  background: #f8fafc;
}
.summary-card .summary-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 15px rgb(15 23 42 / 8%);
}
.summary-card small { display: block; color: var(--app-muted); font-weight: 700; }
.summary-card strong { display: block; margin-top: .15rem; font-size: clamp(1.22rem, 2vw, 1.65rem); }
.summary-due .summary-icon { color: var(--app-primary); }
.summary-paid .summary-icon { color: #475569; }
.summary-difference.is-positive { border-color: #86efac; background: #f0fdf4; }
.summary-difference.is-positive .summary-icon,
.summary-difference.is-positive strong { color: var(--app-success); }
.summary-difference.is-negative { border-color: #fecaca; background: #fef2f2; }
.summary-difference.is-negative .summary-icon,
.summary-difference.is-negative strong { color: var(--app-danger); }

.memory-card {
  height: 100%;
  padding: .95rem;
  border: 1px solid var(--app-border);
  border-radius: 13px;
  background: #fff;
}
.memory-card h3 { margin: 0 0 .5rem; font-size: .85rem; font-weight: 800; }
.memory-card .memory-value { font-size: 1.08rem; font-weight: 900; }
.memory-card code {
  display: block;
  margin-top: .5rem;
  padding: .5rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: .68rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rule-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .9rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #f8fafc;
}
.rule-card strong { color: var(--app-primary-strong); }
.rule-card span { color: var(--app-muted); }

.preset-card {
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.preset-card:hover { transform: translateY(-2px); border-color: #7dd3fc; box-shadow: 0 10px 25px rgb(15 23 42 / 9%); }
.preset-card p { min-height: 2.5em; color: var(--app-muted); font-size: .77rem; }
.preset-year {
  grid-column: 1 / -1;
  margin-top: .4rem;
  color: var(--app-primary-strong);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-header-primary {
  border-bottom: 0;
  background: linear-gradient(115deg, var(--app-primary-strong), var(--app-primary));
  color: #fff;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem .25rem 0;
  color: var(--app-muted);
  font-size: .75rem;
}

@media (max-width: 1199.98px) {
  body { padding-top: 72px; }
  .navbar-collapse { padding-bottom: .6rem; }
}

@media (max-width: 767.98px) {
  body { padding-top: 70px; }
  .hero-card { padding: 1.1rem; border-radius: 15px; }
  .app-card { border-radius: 14px; }
  .app-card-header { align-items: flex-start; }
  .calculation-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-tools { width: 100%; align-items: stretch; }
  .search-group { width: 100%; }
  .status-panel { min-width: 100%; }
}

@media (max-width: 479.98px) {
  .calculation-strip { grid-template-columns: 1fr; }
  .summary-card { min-height: 92px; }
  .app-card-header { padding-inline: .9rem; }
}

@media print {
  @page { size: A4 landscape; margin: 9mm; }
  body { padding: 0; background: #fff !important; font-size: 10px; }
  .appbar,
  #btnAdicionarVerba,
  #btnAdicionarComponente,
  .table-tools,
  .drag-handle,
  .action-cell,
  .toast-container,
  .tip-box,
  #modalCompetencias,
  footer { display: none !important; }
  main { max-width: none; padding: 0 !important; }
  .hero-card,
  .app-card { box-shadow: none; break-inside: avoid; }
  .hero-card { padding: .5rem; margin-bottom: 7mm !important; }
  .app-card { border-radius: 0; margin-bottom: 6mm !important; }
  .card-body { padding: .6rem !important; }
  .table-container { max-height: none; overflow: visible; }
  .table { font-size: 7.5px; }
  .table thead th { position: static; padding: 4px; }
  .table tbody td { padding: 4px; }
  .table input,
  .table select { border: 0 !important; padding: 0 !important; background: transparent !important; font-size: inherit !important; }
  .formula-preview { font-size: 6.5px; }
  .accordion-collapse { display: block !important; }
  .accordion-button::after { display: none; }
  .accordion-button { padding: .5rem; }
  .summary-card { min-height: 70px; padding: .6rem; }
}

/* ===== Versão 2.1.0: tooltips, toggles e edição bidirecional ===== */
.info-icon {
  margin-left: .25rem;
  color: var(--app-primary);
  font-size: .78rem;
  cursor: help;
  opacity: .82;
}
.info-icon:hover,
.info-icon:focus { opacity: 1; outline: none; }
.tooltip { --bs-tooltip-max-width: 330px; }
.tooltip-inner { padding: .65rem .75rem; text-align: left; font-size: .78rem; line-height: 1.45; }

.page-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  padding: .65rem;
  border: 1px solid var(--app-border);
  border-radius: 17px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 26px rgb(15 23 42 / 7%);
  position: sticky;
  top: 78px;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.page-nav-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem .85rem;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #475569;
  text-align: left;
  transition: .18s ease;
}
.page-nav-item:hover { background: #f1f5f9; color: var(--app-primary-strong); }
.page-nav-item.active {
  border-color: #7dd3fc;
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
  box-shadow: inset 0 0 0 1px rgb(2 132 199 / 8%);
}
.page-nav-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e2e8f0;
}
.page-nav-item.active .page-nav-icon { background: var(--app-primary); color: #fff; }
.page-nav-item strong,
.page-nav-item small { display: block; }
.page-nav-item strong { font-size: .83rem; }
.page-nav-item small { margin-top: .08rem; color: var(--app-muted); font-size: .68rem; }
.app-page { animation: pageIn .18s ease; }
.app-page[hidden] { display: none !important; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.workflow-card {
  position: relative;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 15px;
  background: #fff;
  text-align: left;
  transition: .18s ease;
}
.workflow-card:hover { transform: translateY(-2px); border-color: #7dd3fc; box-shadow: 0 12px 25px rgb(15 23 42 / 8%); }
.workflow-card > span {
  position: absolute;
  top: .7rem;
  right: .8rem;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 900;
  font-size: .75rem;
}
.workflow-card > i { margin: .15rem 0 .55rem; color: var(--app-primary); font-size: 1.55rem; }
.workflow-card strong { color: #0f172a; font-size: .92rem; }
.workflow-card small { color: var(--app-muted); line-height: 1.45; }
.instruction-panel {
  display: flex;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: .82rem;
}
.instruction-panel > i { margin-top: .2rem; font-size: 1.15rem; }
.instruction-panel strong { display: block; margin-bottom: .25rem; }
.home-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.home-summary > div {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .9rem;
  border: 1px solid var(--app-border);
  border-radius: 13px;
  background: #f8fafc;
}
.home-summary span { color: var(--app-muted); font-size: .72rem; font-weight: 700; }
.home-summary strong { margin-top: .2rem; font-size: 1.08rem; }
.home-summary .is-positive { background: #f0fdf4; border-color: #86efac; }
.home-summary .is-positive strong { color: var(--app-success); }
.home-summary .is-negative { background: #fef2f2; border-color: #fecaca; }
.home-summary .is-negative strong { color: var(--app-danger); }
.page-actions { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }

/* Toggle acessível e consistente */
.app-toggle {
  --toggle-width: 42px;
  --toggle-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.app-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.app-toggle-track {
  width: var(--toggle-width);
  height: var(--toggle-height);
  flex: 0 0 var(--toggle-width);
  padding: 3px;
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e2e8f0;
  transition: .18s ease;
}
.app-toggle-track > span {
  width: calc(var(--toggle-height) - 8px);
  height: calc(var(--toggle-height) - 8px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgb(15 23 42 / 25%);
  transition: transform .18s ease;
}
.app-toggle > input:checked + .app-toggle-track { border-color: var(--app-primary); background: var(--app-primary); }
.app-toggle > input:checked + .app-toggle-track > span { transform: translateX(calc(var(--toggle-width) - var(--toggle-height))); }
.app-toggle > input:focus-visible + .app-toggle-track { outline: 3px solid rgb(2 132 199 / 20%); outline-offset: 2px; }
.app-toggle-copy strong,
.app-toggle-copy small { display: block; }
.app-toggle-copy strong { color: #334155; font-size: .78rem; line-height: 1.1; }
.app-toggle-copy small { margin-top: .17rem; color: var(--app-muted); font-size: .67rem; line-height: 1.2; }
.app-toggle-wide {
  width: 100%;
  min-height: 48px;
  padding: .55rem .7rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #f8fafc;
}
.app-toggle-compact { --toggle-width: 36px; --toggle-height: 21px; gap: .45rem; }
.app-toggle-icon { --toggle-width: 36px; --toggle-height: 20px; justify-content: center; }
.component-toggle-group { display: grid; gap: .45rem; }

.editing-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--app-border);
  background: #f8fafc;
  color: #475569;
  font-size: .72rem;
}
.editing-legend > span:first-child { margin-right: auto; font-weight: 700; }
.source-example,
.calculated-example { padding: .25rem .5rem; border-radius: 7px; border: 1px solid; }
.source-example { border-color: #38bdf8; background: #f0f9ff; color: #0369a1; }
.calculated-example { border-color: #e2e8f0; background: #fff; color: #64748b; }
.editable-calculation { position: relative; min-width: 115px; padding-bottom: 14px; }
.editable-calculation .form-control,
.editable-calculation .input-group-text { transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.editable-calculation.calculation-source .form-control,
.editable-calculation.calculation-source .input-group-text {
  border-color: #38bdf8;
  background: #f0f9ff;
}
.editable-calculation.calculation-source .form-control:focus { box-shadow: 0 0 0 .18rem rgb(14 165 233 / 15%); }
.editable-calculation.calculation-output .form-control,
.editable-calculation.calculation-output .input-group-text { background: #f8fafc; color: #64748b; }
.calculation-mode-label {
  position: absolute;
  right: 2px;
  bottom: 0;
  color: #64748b;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.calculation-source .calculation-mode-label { color: #0284c7; }
.table input[type="number"] { min-width: 108px; }
.formula-preview { font-variant-numeric: tabular-nums; }

/* Notificações robustas */
.app-notification {
  width: min(430px, calc(100vw - 2rem));
  border: 0;
  border-left: 5px solid var(--app-primary);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgb(15 23 42 / 22%);
  overflow: hidden;
}
.app-notification .toast-header { padding: .8rem .9rem; border-bottom-color: #e2e8f0; }
.app-notification .toast-body { padding: .9rem 1rem 1rem; color: #334155; line-height: 1.45; }
.notification-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-right: .65rem;
  border-radius: 10px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.05rem;
}
.notification-details { margin: .7rem 0 0; padding: .65rem .75rem .65rem 1.75rem; border-radius: 9px; background: #f8fafc; font-size: .75rem; }
.notification-details li + li { margin-top: .25rem; }
.notification-success { border-left-color: var(--app-success); }
.notification-success .notification-icon { background: #dcfce7; color: var(--app-success); }
.notification-warning { border-left-color: #d97706; }
.notification-warning .notification-icon { background: #fef3c7; color: #b45309; }
.notification-danger { border-left-color: var(--app-danger); }
.notification-danger .notification-icon { background: #fee2e2; color: var(--app-danger); }

@media (max-width: 991.98px) {
  .page-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
  .workflow-grid { grid-template-columns: 1fr; }
  .workflow-card { min-height: 135px; }
}
@media (max-width: 575.98px) {
  .page-navigation { grid-template-columns: 1fr 1fr; gap: .4rem; padding: .45rem; }
  .page-nav-item { padding: .55rem; gap: .45rem; }
  .page-nav-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .page-nav-item small { display: none; }
  .home-summary { grid-template-columns: 1fr; }
  .page-actions .btn { width: 100%; }
}

@media print {
  .page-navigation { display: none !important; }
  .app-page { display: block !important; }
  .app-page[hidden] { display: block !important; }
  [data-page="inicio"], [data-page="parametros"] .page-actions, [data-page="lancamentos"] .page-actions, [data-page="resultados"] .page-actions,
  .editing-legend { display: none !important; }
}

/* ===== Versão 2.1.1: página única, calendário e divisores selecionáveis ===== */
.app-page {
  display: block !important;
  scroll-margin-top: 92px;
}

.app-page[hidden] {
  display: block !important;
}

.app-page + .app-page {
  margin-top: 1rem;
}

.competence-picker .form-control[type="month"] {
  min-width: 0;
  cursor: pointer;
}

.competence-picker .btn {
  min-width: 46px;
  display: inline-grid;
  place-items: center;
}

.calendar-hint {
  min-height: 1.2rem;
  color: #475569;
  line-height: 1.35;
}

.form-text {
  margin-top: .35rem;
  color: #64748b;
  font-size: .72rem;
}

section[data-page="parametros"] > .app-card,
section[data-page="resultados"] > .app-card {
  margin-bottom: 0 !important;
}

@media (max-width: 575.98px) {
  .competence-picker .btn {
    min-width: 44px;
  }
}

/* ===== Versão 2.1.3: grade wide real para os cards 1 e 2 ===== */
.primary-cards-grid {
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.primary-card-main,
.primary-card-side {
  min-width: 0;
}

.primary-card-main > .app-card,
.primary-card-side > .app-card {
  height: 100%;
}

@media (min-width: 1600px) {
  .primary-cards-grid {
    grid-template-columns: minmax(0, 68%) minmax(420px, 32%);
    gap: 1.25rem;
  }

  main.app-wide,
  .navbar .app-wide {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

@media (max-width: 1199.98px) {
  .primary-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== v3 shell / landing ===== */
:root {
  --shell-paper: #f7f2e8;
  --shell-paper-strong: #f3ede1;
  --shell-line: rgba(155, 121, 63, .18);
  --shell-ink: #2a3555;
  --shell-blue: #2f48ae;
  --shell-blue-soft: #eaf0ff;
  --shell-red: #c6525f;
  --shell-green: #1b8d63;
  --shell-orange: #ef9e23;
}
body,
.quick-calculator-page {
  background:
    linear-gradient(to bottom, rgba(155,121,63,.11) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--shell-paper);
}
.material-icons-round {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}
.shell-navbar.appbar,
.appbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(47,72,174,.12);
}
.shell-brand,
.navbar-brand { color: var(--shell-ink) !important; }
.shell-logo {
  width: 52px; height: 52px; display:grid; place-items:center; border-radius: 16px;
  background: linear-gradient(135deg, var(--shell-blue-soft), #fff); color: var(--shell-blue);
  border: 1px solid rgba(47,72,174,.16); font-size: 30px;
}
.shell-kicker { display:block; text-transform: uppercase; letter-spacing: .18em; color: var(--shell-red); font-size: .72rem; font-weight: 800; }
.shell-title { font-family: 'Caveat', cursive; color: var(--shell-blue); font-size: 3rem; line-height: .92; }
.shell-subtitle, .brand-subtitle { color: #6c7488 !important; }
.shell-action-btn, .navbar .btn {
  border-radius: 14px; border: 1px solid rgba(47,72,174,.16);
  background: rgba(255,255,255,.9); color: var(--shell-ink);
}
.shell-action-btn:hover, .navbar .btn:hover { background: var(--shell-blue-soft); }
.app-wide { max-width: 1750px; }
body { padding-top: 94px; color: var(--shell-ink); }
.shell-panel, .hero-card, .app-card, .quick-input-card, .quick-result-card {
  background: rgba(255,255,255,.82); border: 1px solid rgba(47,72,174,.12);
  border-radius: 26px; box-shadow: 0 12px 34px rgba(50,50,93,.08);
}
.landing-hero { padding: 2rem; }
.eyebrow-shell, .eyebrow { display:inline-flex; align-items:center; gap:.45rem; color: var(--shell-red); font-size:.82rem; font-weight:800; text-transform: uppercase; letter-spacing:.08em; }
.shell-heading { font-family: 'Caveat', cursive; color: var(--shell-blue); font-size: clamp(3rem, 4vw, 4.8rem); line-height: .95; margin: .5rem 0 1rem; }
.shell-lead { font-size: 1.06rem; color: #536078; max-width: 62rem; }
.hero-pill-list { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:1.2rem; }
.hero-pill { display:inline-flex; align-items:center; gap:.45rem; padding:.55rem .9rem; border-radius:999px; background:#fff; border:1px solid rgba(47,72,174,.12); font-weight:600; color:#52617b; }
.shell-card { display:flex; gap:1rem; padding:1.3rem; border-radius:22px; background: linear-gradient(180deg, #fff, #f9fbff); border:1px solid rgba(47,72,174,.12); }
.shell-card-highlight { min-height: 100%; }
.shell-card-icon { width:64px; height:64px; border-radius:18px; display:grid; place-items:center; font-size: 30px; }
.shell-icon-calc { background: rgba(47,72,174,.12); color: var(--shell-blue); }
.section-tag { text-transform: uppercase; letter-spacing: .12em; font-size: .73rem; font-weight: 800; color: var(--shell-red); }
.shell-section-title { font-size: 1.7rem; font-weight: 800; color: var(--shell-ink); }
.shell-steps li { margin-bottom:.45rem; color:#586684; }
.mode-card { padding: 1.5rem; border-radius: 24px; background: linear-gradient(180deg,#fff,#fbfdff); border:1px solid rgba(47,72,174,.14); box-shadow: 0 8px 24px rgba(50,50,93,.07); }
.mode-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.mode-badge { display:inline-flex; align-items:center; padding:.35rem .65rem; background:var(--shell-blue-soft); color:var(--shell-blue); border-radius:999px; font-weight:700; font-size:.85rem; }
.mode-icon { width:54px; height:54px; display:grid; place-items:center; border-radius:16px; font-size:30px; }
.mode-card-calculadora .mode-icon { background: rgba(27,141,99,.12); color: var(--shell-green); }
.mode-card-diferenca .mode-icon { background: rgba(239,158,35,.14); color: var(--shell-orange); }
.mode-card h3 { font-size: 1.45rem; font-weight: 800; margin-bottom:.6rem; }
.mode-card p { color:#586684; }
.mode-list { padding-left:1.2rem; color:#56637b; }
.mode-list li { margin-bottom:.42rem; }
.mode-actions { margin-top: 1rem; display:flex; }
.mode-actions .btn { display:inline-flex; align-items:center; gap:.35rem; border-radius: 14px; }
.shell-accordion .accordion-item,
.accordion-item { border:1px solid rgba(47,72,174,.12); border-radius: 18px !important; overflow:hidden; background: rgba(255,255,255,.74); }
.shell-accordion .accordion-button,
.accordion-button { background: rgba(235,240,255,.7); color: var(--shell-ink); font-weight: 700; box-shadow:none; }
.shell-accordion .accordion-button:not(.collapsed),
.accordion-button:not(.collapsed) { background: rgba(227,234,255,.9); color: var(--shell-blue); }
.shell-modal .modal-content,
.shell-modal { border-radius: 24px; background: #fff; border:1px solid rgba(47,72,174,.12); }
.settings-shortcut { display:flex; flex-direction:column; gap:.2rem; padding:1rem; text-decoration:none; color:inherit; background:#f8faff; border:1px solid rgba(47,72,174,.12); border-radius:18px; }
.settings-shortcut span.material-icons-round { color: var(--shell-blue); font-size: 28px; }
.settings-shortcut strong { color: var(--shell-ink); }
.settings-shortcut small { color:#647089; }
.app-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.8rem; color:#66748f; padding: 1rem 0; font-size:.9rem; }
.info-icon { color: var(--shell-blue); }
.app-card-header { background: transparent; border-bottom: 1px solid rgba(47,72,174,.1); }
.section-number { background: var(--shell-blue-soft); color: var(--shell-blue); }
.status-panel, .quick-status-panel { background: rgba(250,252,255,.92); border:1px solid rgba(47,72,174,.12); }
.search-group .input-group-text, .input-group-text { background: #fff; }
.primary-cards-grid { gap: 1rem; }
.primary-card-main .card, .primary-card-side .card { min-height: 100%; }
.quick-summary-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.quick-summary-card { background:#fff; border:1px solid rgba(47,72,174,.12); border-radius:18px; padding:1rem; display:flex; gap:.8rem; align-items:center; }
.quick-summary-total { background: linear-gradient(180deg, #f8fbff, #ecf3ff); }
.quick-summary-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background: var(--shell-blue-soft); color: var(--shell-blue); }
@media (max-width: 992px) {
  .shell-title { font-size: 2.4rem; }
  .quick-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
  .quick-summary-grid { grid-template-columns: 1fr; }
  .landing-hero, .shell-panel { padding: 1.2rem; }
}

/* ===== v3.1 refinements ===== */
.material-icons-round {
  font-family: 'Material Icons Round' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  vertical-align: -.14em;
}
.mi-blue { color: #2563eb !important; }
.mi-purple { color: #7c3aed !important; }
.mi-green { color: #059669 !important; }
.mi-orange { color: #ea580c !important; }
.mi-red { color: #dc2626 !important; }
.mi-slate { color: #64748b !important; }

.main-expander-header {
  position: relative;
  padding-right: 4.2rem !important;
  cursor: pointer;
}
.main-expander-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4f7ff;
  border: 1px solid #cbd8f4;
}
.main-expander-toggle .material-icons-round { transition: transform .2s ease; }
.main-expander-toggle:not(.collapsed) .material-icons-round { transform: rotate(180deg); }
[data-main-expander] > .card-body.collapse:not(.show) { display: none; }

.creator-pill {
  margin-inline: auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  border: 1px solid #cbd8f4;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #243b75;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(47,72,174,.08);
}
.creator-pill:hover { background: #eef3ff; color: #1d4ed8; }
.creator-pill-separator { width: 1px; height: 18px; background: #d7deed; }
.creator-pill small { color: #c24155; font-weight: 700; }

.competence-picker [data-competence-display] {
  background: #fff;
  cursor: pointer;
  font-weight: 650;
}
.competence-modal .modal-dialog { max-width: 560px; }
.competence-modal .modal-content {
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(15,23,42,.28);
}
.competence-modal-header {
  border: 0;
  padding: 1.2rem 1.25rem .4rem;
  align-items: center;
}
.competence-modal-header small { color: #64748b; }
.competence-round-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid #cbd8f4;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #164e75;
}
.competence-picker-panel {
  background: #f8fbff;
  border: 1px solid #cfe0f5;
  border-radius: 20px;
  padding: 1rem;
}
.competence-year-nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  text-align: center;
  gap: .7rem;
  margin-bottom: .8rem;
}
.competence-year-nav strong { font-size: 1.08rem; color: #17416c; }
.competence-month-grid,
.competence-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}
.competence-month-btn,
.competence-year-btn {
  border: 1px solid #c7d8ef;
  background: #fff;
  color: #173b63;
  border-radius: 13px;
  font-weight: 750;
  min-height: 42px;
}
.competence-month-btn:hover,
.competence-year-btn:hover { background: #eef4ff; border-color: #8fb0e2; }
.competence-month-btn.is-selected,
.competence-year-btn.is-selected {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #6d3dd1);
  box-shadow: 0 8px 18px rgba(70,66,190,.22);
}
.competence-year-labels {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 .45rem;
  color: #64748b;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.smart-source-control { display: grid; gap: .25rem; min-width: 150px; }
.smart-source-control > span {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  font-weight: 800;
}
.smart-source-control select {
  border-color: #c7d8ef;
  background-color: #f8fbff;
  font-size: .75rem;
}
.editable-calculation input[readonly] {
  background: #f3f6fa;
  color: #65748a;
  cursor: not-allowed;
}
.calculation-mode-label { white-space: nowrap; }

.documentation-page .doc-hero { padding: 2rem; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.doc-card { background:#fff; border:1px solid #d6e1f0; border-radius:20px; padding:1.15rem; }
.doc-card-icon { width:46px; height:46px; border-radius:14px; display:grid; place-items:center; background:#eef3ff; margin-bottom:.75rem; }
.doc-formula { display:block; background:#0f2742; color:#e8f4ff; border-radius:12px; padding:.8rem; margin-top:.7rem; overflow:auto; }
.doc-example { border-left:4px solid #7c3aed; background:#f7f3ff; padding:.8rem 1rem; border-radius:0 12px 12px 0; }
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: 1fr; }
  .competence-month-grid, .competence-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.smart-comparison-banner {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0;
  padding: .85rem 1rem;
  background: linear-gradient(90deg, #f4f0ff, #f8fbff);
  border-bottom: 1px solid #d8dff1;
  color: #344367;
}
.smart-comparison-banner > .material-icons-round {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(66,59,141,.09);
  font-size: 25px;
}
.smart-comparison-banner strong,
.smart-comparison-banner small { display: block; }
.smart-comparison-banner small { color: #65728c; margin-top: .1rem; }
.creator-pill-row {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  margin-top: .25rem;
}
/* Controles visuais também usam Google Icons */
.accordion-button::after {
  width: auto;
  height: auto;
  margin-left: auto;
  background: none !important;
  transform: none !important;
  content: 'expand_more';
  font-family: 'Material Icons Round';
  font-size: 1.35rem;
  font-feature-settings: 'liga';
  color: #3159b8;
  transition: transform .2s ease;
}
.accordion-button:not(.collapsed)::after { transform: rotate(180deg) !important; }
.btn-close {
  background: none !important;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: grid;
  place-items: center;
  opacity: 1;
  border-radius: 50%;
}
.btn-close::before {
  content: 'close';
  font-family: 'Material Icons Round';
  font-size: 1.25rem;
  font-feature-settings: 'liga';
  color: #475569;
}
.navbar-toggler { color: #24427a; border-color: #cbd8f4; }
.navbar-toggler .material-icons-round { font-size: 1.55rem; }

/* ===== v3.2.0 refinements ===== */
body { padding-bottom: 78px; }
.app-footer { min-height: 12px; padding: 0; margin: 0; }
.fixed-creator-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  display: flex;
  justify-content: center;
  padding: .45rem 1rem;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(247,242,232,.96) 32%);
}
.fixed-creator-footer .creator-pill {
  pointer-events: auto;
  margin: 0;
  padding: .48rem .9rem;
  max-width: calc(100vw - 2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.creator-pill-separator,
.creator-pill small { display: none !important; }

.appbar-icon-actions { align-items: center; }
.appbar-icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  border-radius: 50% !important;
  background: #fff !important;
  color: #294878 !important;
  border: 1px solid #d7e0f0 !important;
  box-shadow: 0 4px 12px rgba(31,61,112,.07);
}
.appbar-icon-btn:hover,
.appbar-icon-btn:focus-visible {
  background: #eef4ff !important;
  border-color: #9eb8e7 !important;
  transform: translateY(-1px);
}
.appbar-icon-btn .material-icons-round { font-size: 1.3rem; }
.home-brand-icon {
  background: #eef4ff !important;
  border-color: #c7d8f3 !important;
}
.home-brand-icon .material-icons-round { font-size: 1.45rem; }

/* Garante que textos de ligatura nunca apareçam como palavras. */
.material-icons-round {
  font-family: 'Material Icons Round' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
}

/* Documentação: conteúdo contido, legível e responsivo. */
.documentation-page main { max-width: 1480px; }
.documentation-page .shell-panel { overflow: hidden; }
.documentation-page .doc-hero {
  padding: clamp(1.25rem, 2vw, 2.25rem);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,245,255,.92));
}
.documentation-page .shell-heading {
  font-size: clamp(2.7rem, 5vw, 4.4rem);
  overflow-wrap: anywhere;
}
.doc-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.doc-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: anywhere;
}
.doc-card p { color: #596781; line-height: 1.6; }
.doc-formula {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
}
.doc-example {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.documentation-page .accordion-item { margin-bottom: .75rem !important; }
.documentation-page .accordion-button {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.documentation-page .accordion-button > .material-icons-round {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(35,63,112,.08);
}
.documentation-page .accordion-body {
  padding: 1.15rem;
  overflow: hidden;
}
.documentation-page .accordion-body p { line-height: 1.65; color: #4f5f7a; }
@media (max-width: 991.98px) {
  .doc-grid { grid-template-columns: 1fr; }
}

/* Seletor de competência: somente o campo textual e um único calendário. */
.competence-picker input[type="month"].d-none { display: none !important; }
.competence-picker [data-competence-display] {
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.competence-open-btn { width: 46px; padding-inline: 0; }

/* ===== v3.3.0 — central com três modos ===== */
.landing-main-title { font-size: clamp(2.45rem, 4vw, 3.8rem); }
.mode-card { display: flex; flex-direction: column; }
.mode-card .mode-actions { margin-top: auto; padding-top: .75rem; }
.mode-card-retroativo .mode-icon { background: rgba(124,58,237,.12); color: #7c3aed; }
.mode-card-retroativo { border-color: rgba(124,58,237,.18); }
@media (min-width: 1200px) {
  .mode-card { min-height: 100%; }
}

/* ===== v3.3.1 refinements ===== */
.mode-card-top { justify-content: flex-end; }
.mode-card .btn .material-icons-round { margin-right: .35rem; }
.mode-card .btn { gap: .35rem; }
.doc-card { padding: 1.5rem !important; }
.doc-card-icon { width: auto; height: auto; background: transparent !important; box-shadow: none !important; border-radius: 0 !important; margin-bottom: .9rem; }
.doc-card-icon .material-icons-round, .doc-card > .material-icons-round { font-size: 2rem; }
.documentation-page .accordion-button > .material-icons-round { background: transparent; box-shadow: none; width: auto; height: auto; border-radius: 0; }
.app-toggle-compact { align-items: center; gap: .65rem; }
.app-toggle-compact .app-toggle-copy strong { font-size: .86rem; }
.app-toggle-compact .app-toggle-copy small { display: block; color: #66748e; }
.retro-input-group-compact .form-control, .retro-input-group-compact .input-group-text { min-height: 42px; }
.mobile-mode-shortcuts { display: none; width: 100%; margin-top: .75rem; gap: .5rem; }
.mobile-mode-shortcuts .btn { flex: 1 1 0; min-height: 42px; border-radius: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; background: #fff; border: 1px solid #d7e0f0; color: #294878; }
.mobile-mode-shortcuts .btn.is-active { background: linear-gradient(135deg,#2563eb,#6d3dd1); color: #fff; border-color: transparent; }
@media (max-width: 767.98px) { .mobile-mode-shortcuts { display: flex; } .appbar .container-fluid { padding-bottom: .75rem; } .mode-card .mode-actions .btn { width: 100%; } }
.competence-modal .modal-dialog { max-width: min(980px, calc(100vw - 1rem)); }
.competence-modal .modal-content { border-radius: 28px; background: #f7f9fc; }
.competence-modal .modal-header, .competence-modal .modal-footer { border: 0; }
.competence-topband { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 24px 24px 0 0; background: linear-gradient(90deg,#26539a,#7538b8); color: #fff; }
.competence-topband > div { padding: 1rem; text-align: center; }
.competence-topband small { display: block; opacity: .82; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }
.competence-topband strong { display: block; font-size: 1.2rem; margin-top: .2rem; }
.competence-modal-body { padding: 1rem 1rem 1.1rem; }
.competence-summary-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: .75rem; align-items: center; margin-bottom: .9rem; }
.competence-summary-card { background: #edf2f8; border-radius: 18px; padding: .95rem 1rem; text-align: center; }
.competence-summary-card strong { display: block; font-size: clamp(1.15rem, 2vw, 1.65rem); color: #143f6c; }
.competence-summary-card small { color: #6a7a94; }
.competence-toolbar { display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin-bottom: .9rem; flex-wrap: wrap; }
.competence-view-toggle { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: #edf2f7; border: 1px solid #d2ddec; }
.competence-view-toggle .btn { border-radius: 999px; min-height: 38px; border: 0; color: #21456f; font-weight: 800; }
.competence-view-toggle .btn.is-active { background: #fff; box-shadow: 0 2px 8px rgba(31,61,112,.08); }
.competence-calendar-wrap { border: 1px solid #cfdaea; border-radius: 22px; padding: .85rem; background: #f5f8fc; }
.competence-quick-panel { margin-bottom: .85rem; border: 1px solid #cfdaea; border-radius: 20px; padding: .85rem; background: #f8fbff; }
.competence-panel-yearhead { display: grid; grid-template-columns: 44px 1fr 44px; gap: .5rem; align-items: center; text-align: center; margin-bottom: .8rem; }
.competence-panel-yearhead strong { color: #17416c; font-size: 1.05rem; }
.competence-month-grid, .competence-year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.competence-month-btn, .competence-year-btn, .competence-day-btn { border: 1px solid #c7d8ef; background: #fff; color: #173b63; border-radius: 13px; font-weight: 750; min-height: 42px; }
.competence-month-btn.is-selected, .competence-year-btn.is-selected { color: #fff; border-color: transparent; background: linear-gradient(135deg, #2563eb, #6d3dd1); box-shadow: 0 8px 18px rgba(70,66,190,.22); }
.competence-year-labels { display: flex; justify-content: space-between; margin: .8rem 0 .45rem; color: #64748b; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.competence-months-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.competence-month-card { border: 1px solid #cfdaea; border-radius: 18px; padding: .7rem .7rem .85rem; background: #fff; }
.competence-month-title { text-align: center; color: #163f6a; font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
.competence-month-title small { color: #6c7c95; margin-left: .25rem; }
.competence-weekdays, .competence-days-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.competence-weekdays span { text-align: center; font-size: .78rem; font-weight: 800; color: #7c3aed; padding: .3rem 0; }
.competence-day-btn { min-height: 40px; padding: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.competence-day-btn.is-muted { color: #bac4d1; background: transparent; border-color: transparent; }
.competence-day-btn.is-selected { border-color: #b56be8; color: #7c3aed; box-shadow: inset 0 0 0 1px #c084fc; }
.competence-day-btn.is-today { box-shadow: inset 0 0 0 1px #8bb3ec; }
.competence-footer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .9rem; }
.competence-status-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border-radius: 999px; background: #eef2f7; color: #58708d; font-weight: 700; }
.competence-footer-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 900px) { .competence-months-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .competence-month-grid, .competence-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .competence-summary-row { grid-template-columns: 40px 1fr 40px; gap: .5rem; } .competence-footer-actions { width: 100%; } .competence-footer-actions .btn { flex: 1 1 0; } }

/* ===== v3.3.2 refinements ===== */
.shell-card-clean { background: linear-gradient(180deg, #ffffff, #fbfdff); padding: 1.55rem; }
.shell-card-clean .shell-card-icon { background: transparent; width: auto; height: auto; border-radius: 0; }
.shell-card-clean .shell-card-icon .material-icons-round { font-size: 2.2rem; }
.mode-card, .doc-card, .download-card { padding: 1.5rem !important; }
.mode-card h3, .doc-card h3, .download-card h3 { margin-top: .35rem; margin-bottom: .7rem; }
.mode-card p, .doc-card p, .download-card p { line-height: 1.65; margin-bottom: .9rem; }
.mode-card-top { justify-content: flex-start; margin-bottom: .8rem; }
.mode-icon, .download-card > .material-icons-round {
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 2rem !important;
  display: inline-flex;
}
.mode-card-calculadora .mode-icon { color: var(--shell-green); }
.mode-card-diferenca .mode-icon { color: var(--shell-orange); }
.mode-card-retroativo .mode-icon { color: #7c3aed; }
.mode-btn { background: transparent !important; font-weight: 700; }
.mode-btn .material-icons-round { margin-right: .35rem; }
.mode-btn-calc { color: var(--shell-green) !important; border-color: rgba(27,141,99,.45) !important; }
.mode-btn-diff { color: var(--shell-orange) !important; border-color: rgba(239,158,35,.45) !important; }
.mode-btn-retro { color: #7c3aed !important; border-color: rgba(124,58,237,.35) !important; }
.mode-btn:hover, .mode-btn:focus { background: rgba(37,99,235,.04) !important; }
.download-card {
  height: 100%;
  background: linear-gradient(180deg,#fff,#fbfdff);
  border:1px solid rgba(47,72,174,.14);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(50,50,93,.07);
  display:flex;
  flex-direction:column;
}
.download-card .btn { margin-top: auto; align-self: flex-start; }
.documentation-page .shell-panel,
.landing-body .shell-panel { padding: 1.5rem; }
.documentation-page .accordion-button .material-icons-round { min-width: 24px; }
.documentation-page .accordion-button { align-items: center; }
.doc-card-icon { width: auto; height: auto; background: transparent !important; border-radius: 0 !important; margin-bottom: .8rem; }
.doc-card-icon .material-icons-round { font-size: 2rem; }
.competence-toolbar { justify-content: flex-end; }
.competence-calendar-wrap { background: #f8fbff; }
.competence-footer-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.competence-months-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:.85rem; }
@media (max-width: 900px) {
  .competence-months-grid { grid-template-columns: 1fr; }
}

/* ===== v3.3.3 — identidade visual unificada e calendário de faltas ===== */
:root {
  --card-thin-border: #d9e3f1;
  --card-thin-shadow: 0 4px 14px rgba(32, 62, 105, .055);
}
.appbar {
  background: rgba(255, 255, 255, .97) !important;
  border-bottom: 1px solid #e2e8f2;
  box-shadow: 0 3px 12px rgba(32, 62, 105, .06) !important;
}
.appbar .brand-icon,
.appbar-icon-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px;
  border-radius: 12px !important;
  background: #fff !important;
  border: 1px solid #dce5f1 !important;
  box-shadow: 0 2px 7px rgba(31, 65, 110, .05) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.appbar .brand-icon .material-icons-round,
.appbar-icon-btn .material-icons-round { font-size: 21px; }
.appbar-icon-btn:hover,
.appbar-icon-btn:focus {
  border-color: #9fb7d7 !important;
  background: #f8fbff !important;
  transform: translateY(-1px);
}
.shell-panel,
.hero-card,
.app-card,
.retro-card,
.retro-result-card,
.settings-shortcut,
.doc-card,
.mode-card,
.download-card,
.status-panel,
.quick-summary-card,
.hour-input-card,
.tip-box {
  border: 1px solid var(--card-thin-border) !important;
  box-shadow: var(--card-thin-shadow) !important;
}
.shell-panel,
.hero-card,
.app-card,
.retro-card,
.retro-result-card { border-radius: 18px !important; }
.mode-card,
.doc-card,
.download-card { border-radius: 16px !important; }
.app-card-header,
.card-header.app-card-header {
  background: #f7f9fd !important;
  border-bottom: 1px solid #e1e8f2 !important;
  padding: .95rem 1.1rem !important;
}
.app-card > .card-body,
.retro-card > .card-body,
.retro-result-card > .card-body { padding: 1.1rem !important; }
.quick-summary-card,
.hour-input-card { border-radius: 14px !important; }
.quick-summary-icon,
.hour-icon,
.notification-icon {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.quick-summary-negative strong,
.quick-formula-negative code,
.dsr-loss-row .result-value { color: #b4233a !important; }
.salary-proportional-row { background: #f4faf6; }
.dsr-loss-row { background: #fff5f6; }

.absence-modal .modal-dialog { max-width: 680px; }
.absence-modal .modal-content {
  border: 1px solid #d8e3f1;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(26, 58, 100, .16);
  overflow: hidden;
}
.absence-modal .modal-header,
.absence-modal .modal-footer {
  border-color: #e3eaf3;
  background: #fbfcff;
}
.absence-month-title {
  font-weight: 800;
  color: #143f6c;
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: .35rem;
}
.absence-calendar-card {
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  background: #f8fbff;
  padding: .85rem;
}
.absence-weekdays,
.absence-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
}
.absence-weekdays span {
  text-align: center;
  color: #6d28d9;
  font-size: .75rem;
  font-weight: 800;
  padding: .2rem 0;
}
.absence-day-placeholder { min-height: 46px; }
.absence-day-btn {
  min-height: 46px;
  border: 1px solid #d7e2f0 !important;
  background: #fff !important;
  color: #173a61 !important;
  border-radius: 12px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .25rem !important;
  font-weight: 750;
}
.absence-day-btn small { min-height: .7rem; font-size: .58rem; color: #8795aa; }
.absence-day-btn.is-sunday { background: #faf7ff !important; }
.absence-day-btn.is-selected {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #e23d5e, #a82d73) !important;
  box-shadow: 0 6px 15px rgba(183, 43, 93, .2) !important;
}
.absence-day-btn.is-selected small { color: rgba(255,255,255,.82); }
.absence-selection-summary {
  display: grid;
  gap: .65rem;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  padding: .85rem;
  background: #fff;
  color: #50627c;
}
.absence-selection-summary p { font-size: .86rem; line-height: 1.5; }
.absence-loss-chip,
.absence-carryover {
  display: flex;
  gap: .55rem;
  align-items: center;
  padding: .65rem .75rem;
  border-radius: 12px;
}
.absence-loss-chip { background: #fff0f3; color: #98233f; }
.absence-loss-chip small { display: block; color: #8b6170; }
.absence-carryover { background: #eef5ff; color: #315b8f; }

.verb-code-note {
  display: block;
  font-size: .75rem;
  color: #71819a;
  margin-top: .2rem;
}
@media (max-width: 575.98px) {
  .absence-weekdays,
  .absence-days-grid { gap: .25rem; }
  .absence-day-btn { min-height: 41px; border-radius: 10px !important; }
  .absence-modal .modal-body { padding: .85rem; }
}

/* ===== v3.3.5 — wide real, cards finos, entrada decimal e tooltips ===== */
.app-wide {
  width: 100% !important;
  max-width: none !important;
}
main.app-wide,
.navbar .app-wide {
  padding-left: 10px !important;
  padding-right: 10px !important;
}
@media (max-width: 767.98px) {
  main.app-wide,
  .navbar .app-wide { padding-left: 6px !important; padding-right: 6px !important; }
}
.shell-panel,
.hero-card,
.app-card,
.mode-card,
.doc-card,
.download-card,
.status-panel,
.settings-shortcut,
.quick-summary-card,
.hour-input-card,
.tip-box {
  border-width: 1px !important;
  border-color: #dde6f1 !important;
  box-shadow: 0 2px 9px rgba(31, 65, 110, .045) !important;
}
.app-card-header,
.card-header.app-card-header {
  min-height: 0 !important;
  padding: .72rem .9rem !important;
  background: #fbfcfe !important;
}
.app-card > .card-body { padding: .9rem !important; }
.rtl-decimal-input {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.rtl-decimal-input:focus { text-align: right !important; }
.tooltip { pointer-events: none !important; }
.tooltip.show { opacity: .96; }

/* ===== v4.4.0 — entrada manual/planilha e edição horas/valor ===== */
.quick-entry-mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem .75rem;
  border: 1px solid #dce6f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 9px rgba(31,65,110,.04);
}
.quick-entry-mode-card__copy { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.quick-entry-mode-card__copy > .material-icons-round { font-size: 20px !important; }
.quick-entry-mode-card__copy div { display: grid; gap: .05rem; }
.quick-entry-mode-card__copy strong { font-size: .78rem; color: #173a61; }
.quick-entry-mode-card__copy small { font-size: .66rem; color: #718096; }
.quick-entry-segmented,
.quick-edit-segmented { display: inline-flex; padding: 3px; border: 1px solid #d9e4ef; border-radius: 11px; background: #f7fafe; }
.quick-entry-mode,
.quick-edit-segmented button { min-height: 31px; padding: .3rem .62rem; border: 0; border-radius: 8px; background: transparent; color: #64748b; font-size: .7rem; font-weight: 800; }
.quick-entry-mode { display: inline-flex; align-items: center; gap: .3rem; }
.quick-entry-mode .material-icons-round { font-size: 16px !important; }
.quick-entry-mode.is-active,
.quick-edit-segmented button.is-active { background: #fff; color: #075985; box-shadow: 0 1px 4px rgba(15,61,91,.12); }
.quick-upload-panel .card-body { padding: .85rem !important; }
.quick-upload-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; }
.quick-upload-drop { min-height: 68px; display: flex; align-items: center; justify-content: center; gap: .65rem; padding: .7rem .9rem; border: 1px dashed #9fc5da; border-radius: 13px; background: #f8fcff; color: #31566f; cursor: pointer; }
.quick-upload-drop:hover,.quick-upload-drop.is-dragging,.quick-upload-drop:focus-visible { border-color:#0284c7; background:#eff9ff; outline:none; }
.quick-upload-drop > .material-icons-round { font-size: 25px !important; }
.quick-upload-drop div { display: grid; gap: .05rem; }
.quick-upload-drop strong { font-size: .77rem; }
.quick-upload-drop small { font-size: .65rem; color: #718096; }
.quick-employee-select { max-width: 560px; padding: .6rem .7rem; border: 1px solid #dce6ef; border-radius: 12px; background: #f8fbfd; }
.quick-upload-note { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .7rem; border: 1px solid #d5e7f2; border-radius: 12px; background: #f5fbff; color: #536b7c; font-size: .69rem; line-height: 1.45; }
.quick-upload-note .material-icons-round { font-size: 17px !important; flex: 0 0 auto; }
.quick-edit-segmented { flex: 0 0 auto; }
.quick-value-field { min-width: 145px; }
.quick-value-field .input-group { flex-wrap: nowrap; }
.quick-value-field .input-group-text { font-size: .68rem; }
.quick-value-field input { text-align: right; font-variant-numeric: tabular-nums; }
@media(max-width:767.98px){
  .quick-entry-mode-card { align-items: stretch; flex-direction: column; }
  .quick-entry-segmented { width: 100%; }
  .quick-entry-mode { flex: 1 1 50%; justify-content: center; }
  .quick-edit-segmented { width: 100%; }
  .quick-edit-segmented button { flex: 1 1 50%; }
  .quick-upload-toolbar > * { flex: 1 1 auto; justify-content: center; }
}

/* ===== v4.4.1 — upload fiel ao holerite + grade compacta ===== */
.quick-upload-layout {
  display: grid;
  grid-template-columns: minmax(250px,.8fr) minmax(330px,1.15fr) minmax(280px,1fr);
  gap: .75rem;
  align-items: stretch;
}
.quick-upload-actions,
.quick-upload-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  justify-content: center;
  padding: .65rem;
  border: 1px solid #e1e9f2;
  border-radius: 12px;
  background: #fbfdff;
}
.quick-upload-mini-help {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #64748b;
  font-size: .66rem;
  font-weight: 700;
}
.quick-upload-mini-help .material-icons-round { font-size: 16px !important; cursor: help; }
.quick-upload-drop { min-height: 82px; margin: 0 !important; }
.quick-employee-select { max-width: none; margin: 0 !important; padding: 0; border: 0; background: transparent; }
.quick-upload-note { margin: 0 !important; min-height: 0; }

.hour-input-card { grid-template-columns: 38px minmax(0,1fr) minmax(118px,132px); min-height: 78px; padding: .68rem .72rem; }
.hour-icon { width: 38px; height: 38px; }
.quick-value-field { min-width: 0; width: 100%; max-width: 132px; display: block; }
.quick-value-field.d-none { display: none !important; }
.quick-value-field .input-group { width: 100%; flex-wrap: nowrap; }
.quick-value-field .input-group-text { flex: 0 0 auto; padding-inline: .48rem; }
.quick-value-field .form-control { min-width: 0; width: 100%; padding-right: .55rem !important; text-align: right; }

.quick-summary-grid { grid-template-columns: repeat(5,minmax(0,1fr)) !important; gap: .6rem !important; }
.quick-summary-card { min-height: 78px !important; padding: .68rem !important; gap: .55rem !important; }
.quick-summary-card strong { font-size: 1rem; }
.quick-summary-icon { width: 36px !important; height: 36px !important; flex-basis: 36px !important; }
.selected-total-card { max-width: 285px; margin-left: auto; padding: .65rem .75rem !important; }

@media (max-width: 1399.98px) {
  .quick-upload-layout { grid-template-columns: 1fr 1.25fr; }
  .quick-upload-context { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px,.65fr) minmax(0,1.35fr); align-items: center; }
  .quick-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
}
@media (max-width: 991.98px) {
  .quick-upload-layout { grid-template-columns: 1fr; }
  .quick-upload-context { grid-column: auto; display: flex; }
  .quick-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 575.98px) {
  .quick-summary-grid { grid-template-columns: 1fr !important; }
  .selected-total-card { max-width: none; margin-left: 0; }
  .hour-input-card { grid-template-columns: 38px minmax(0,1fr); }
  .hour-field,.quick-value-field { grid-column: 1 / -1; max-width: none; }
}


/* ===== v4.5.1 — upload consolidado por empregado e competência ===== */
.quick-upload-selectors { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.quick-upload-selectors .quick-employee-select { min-width:0; }
@media(max-width:767.98px){ .quick-upload-selectors{grid-template-columns:1fr;} }

/* v4.7.2 — horas centesimais/sexagesimais */
.quick-hours-controls{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.quick-hours-format{display:inline-flex;padding:3px;border:1px solid #d8e3ef;border-radius:12px;background:#f8fafc}.quick-hours-format button{border:0;background:transparent;color:#64748b;font-size:.7rem;font-weight:800;padding:.38rem .65rem;border-radius:9px}.quick-hours-format button.is-active{color:#075985;background:#e7f5ff;box-shadow:inset 0 0 0 1px #c6e4f5}

/* r41 — descontos e fechamento do recibo de férias */
.quick-vacation-tax-card{margin-top:14px;border:1px solid var(--bs-border-color,#dfe6ee);border-radius:16px;background:var(--bs-body-bg,#fff);overflow:hidden}
.quick-vacation-tax-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 14px;background:#f7f9fc;border-bottom:1px solid #e6ebf1}.quick-vacation-tax-head>div{display:flex;align-items:flex-start;gap:9px}.quick-vacation-tax-head .material-icons-round{font-size:21px;color:#a61b31}.quick-vacation-tax-head strong{display:block;font-size:.75rem;color:#32465a}.quick-vacation-tax-head small{display:block;margin-top:2px;font-size:.62rem;color:#778697}
.quick-vacation-tax-auto{display:flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid #f0cbd2;border-radius:999px;background:#fff7f8;color:#a61b31;font-size:.62rem;font-weight:800;white-space:nowrap}.quick-vacation-tax-auto input{accent-color:#a61b31}
.quick-vacation-tax-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:12px 14px 8px}.quick-vacation-tax-grid label{min-width:0}.quick-vacation-tax-grid small{display:block;min-height:30px;font-size:.6rem;font-weight:700;color:#687789}.quick-vacation-tax-grid .quick-info-icon{font-size:14px;vertical-align:middle}
.quick-vacation-tax-incidence{display:flex;align-items:flex-start;gap:8px;margin:0 14px 9px;padding:8px 10px;border:1px dashed #d8e0e9;border-radius:10px;background:#fbfcfe}.quick-vacation-tax-incidence input{margin-top:3px;accent-color:#a61b31}.quick-vacation-tax-incidence strong{display:block;font-size:.62rem;color:#475a6d}.quick-vacation-tax-incidence small{display:block;margin-top:2px;font-size:.57rem;color:#8290a0;line-height:1.35}
.quick-vacation-tax-status{display:flex;gap:7px;align-items:flex-start;margin:0 14px 10px;padding:8px 10px;border-radius:10px;background:#eef5ff;color:#315b8a;font-size:.61rem;line-height:1.4}.quick-vacation-tax-status .material-icons-round{font-size:17px}.quick-vacation-tax-status.is-success{background:#eef8f3;color:#246746}.quick-vacation-tax-status.is-warning{background:#fff8e8;color:#8a5a00}
.quick-vacation-tax-families{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:0 14px 12px}.quick-vacation-tax-families span{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border:1px solid #e7ebf0;border-radius:10px;background:#fff}.quick-vacation-tax-families b{font-size:.58rem;color:#667689}.quick-vacation-tax-families em{font-size:.62rem;font-style:normal;font-weight:800;color:#a61b31;white-space:nowrap}
.quick-vacation-receipt-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}.quick-vacation-receipt-totals>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 13px;border:1px solid #e1e7ee;border-radius:13px;background:#fff}.quick-vacation-receipt-totals small{font-size:.63rem;font-weight:800;color:#667689}.quick-vacation-receipt-totals strong{font-size:.82rem}.quick-vacation-receipt-totals .is-provent strong{color:#315b8a}.quick-vacation-receipt-totals .is-discount{border-color:#f0d4d9;background:#fffafb}.quick-vacation-receipt-totals .is-discount strong{color:#a61b31}.quick-vacation-receipt-totals .is-liquid{border-color:#cae8d9;background:#f7fcf9}.quick-vacation-receipt-totals .is-liquid strong{color:#246746}
.quick-vacation-discounts-wrap{margin-top:12px;border:1px solid #eed8dc;border-radius:14px;overflow:hidden;background:#fff}.quick-vacation-discounts-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:#fff7f8;border-bottom:1px solid #eed8dc}.quick-vacation-discounts-head>.material-icons-round{color:#a61b31}.quick-vacation-discounts-head strong{display:block;font-size:.68rem;color:#7f1d2d}.quick-vacation-discounts-head small{display:block;font-size:.57rem;color:#96717a}.quick-vacation-discounts tbody td:last-child{color:#a61b31;font-weight:800}.quick-vacation-discounts .quick-code-pill{background:#feecef;color:#a61b31}
@media(max-width:1150px){.quick-vacation-tax-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.quick-vacation-tax-families{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.quick-vacation-tax-head{flex-direction:column}.quick-vacation-tax-grid{grid-template-columns:1fr 1fr}.quick-vacation-receipt-totals{grid-template-columns:1fr}.quick-vacation-tax-families{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.quick-vacation-tax-grid,.quick-vacation-tax-families{grid-template-columns:1fr}.quick-vacation-tax-grid small{min-height:0}}

/* r42 — recibo de férias, abas, memória por linha e toggles consistentes */
.quick-vacation-tax-expander{
  margin-top:14px;border:1px solid #dfe6ee;border-radius:16px;background:#fff;overflow:hidden;
  box-shadow:0 6px 18px rgba(15,23,42,.035)
}
.quick-vacation-tax-expander>summary{cursor:pointer;list-style:none;user-select:none}
.quick-vacation-tax-expander>summary::-webkit-details-marker{display:none}
.quick-vacation-tax-expander .quick-vacation-tax-head{margin:0;border-bottom:0}
.quick-vacation-tax-expander[open] .quick-vacation-tax-head{border-bottom:1px solid #e6ebf1}
.quick-vacation-expander-chevron{margin-left:auto!important;color:#64748b!important;transition:transform .2s ease}
.quick-vacation-tax-expander[open] .quick-vacation-expander-chevron{transform:rotate(180deg)}
.quick-vacation-tax-body{padding-bottom:2px;background:#fff}
.quick-vacation-tax-toolbar{display:flex;justify-content:flex-end;padding:10px 14px 0}
.quick-vacation-tax-toggle{border:1px solid #f0cbd2;border-radius:999px;background:#fff7f8;padding:6px 10px;color:#a61b31}
.quick-vacation-tax-toggle .app-toggle-copy strong{color:#8f1730}
.quick-vacation-tax-toggle .app-toggle-copy small{color:#9d6471}
.quick-vacation-tax-toggle .app-toggle-track{border-color:#dca7b1;background:#fff}
.quick-vacation-tax-toggle>input:checked+.app-toggle-track{border-color:#b4233d;background:#b4233d}
.quick-vacation-tax-grid--six{grid-template-columns:repeat(6,minmax(0,1fr))}
.quick-vacation-tax-incidence.app-toggle-wide{display:flex;margin:0 14px 9px;padding:9px 11px;cursor:pointer}
.quick-vacation-tax-incidence.app-toggle-wide .app-toggle-copy{min-width:0}
.quick-vacation-tax-incidence.app-toggle-wide .app-toggle-copy strong{color:#475a6d;font-size:.64rem}
.quick-vacation-tax-incidence.app-toggle-wide .app-toggle-copy small{color:#8290a0;font-size:.58rem;line-height:1.35}
.quick-vacation-tax-incidence.app-toggle-wide>input:checked+.app-toggle-track{background:#7c3aed;border-color:#7c3aed}
.quick-vacation-scope-tabs{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:14px}
.quick-vacation-scope-tabs .is-receipt.is-active{border-color:#e0b9c2;background:#fff5f7;color:#991b35}
.quick-vacation-scope-tabs .is-receipt .material-icons-round{color:#b4233d}
.quick-vacation-receipt-pane{margin-top:10px}
.quick-vacation-receipt-columns{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);gap:12px;align-items:start}
.quick-vacation-receipt-column{min-width:0;border:1px solid #dfe6ee;border-radius:15px;overflow:hidden;background:#fff}
.quick-vacation-receipt-column.is-discount{border-color:#eed8dc}
.quick-vacation-receipt-column-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #e5eaf0;background:#f8fafc}
.quick-vacation-receipt-column-head>.material-icons-round{font-size:20px;color:#147a68}
.quick-vacation-receipt-column-head>div{min-width:0;flex:1}
.quick-vacation-receipt-column-head>div strong,.quick-vacation-receipt-column-head>div small{display:block}
.quick-vacation-receipt-column-head>div strong{font-size:.72rem;color:#334155}
.quick-vacation-receipt-column-head>div small{margin-top:1px;font-size:.57rem;color:#7a8898}
.quick-vacation-receipt-column-head>strong{margin-left:auto;white-space:nowrap;font-size:.78rem;color:#166534}
.quick-vacation-receipt-column.is-discount .quick-vacation-receipt-column-head{background:#fff7f8;border-bottom-color:#eed8dc}
.quick-vacation-receipt-column.is-discount .quick-vacation-receipt-column-head>.material-icons-round,
.quick-vacation-receipt-column.is-discount .quick-vacation-receipt-column-head>strong{color:#a61b31}
.quick-memory-cell{min-width:230px;max-width:420px;color:#4b5e73;font-size:.62rem;line-height:1.35}
.quick-memory-cell>span{display:inline}
.quick-memory-info{display:inline-grid;place-items:center;width:20px;height:20px;margin-left:4px;padding:0;border:0;border-radius:0;background:transparent;color:#2563eb;vertical-align:middle;box-shadow:none}
.quick-memory-info:hover,.quick-memory-info:focus-visible{background:transparent;color:#174ea6;outline:0;box-shadow:none}
.quick-memory-info .material-icons-round{font-size:17px}
.quick-results-table th .quick-info-icon{font-size:15px;vertical-align:middle;color:#2563eb}
.quick-results-table td.quick-memory-cell{white-space:normal}
.quick-vacation-results tbody tr td:nth-child(6){color:#5b2aa8}
.quick-vacation-results tbody tr td:nth-child(7){color:inherit}
.quick-vacation-discounts tbody td:last-child{color:#a61b31;font-weight:800}
@media(max-width:1350px){.quick-vacation-tax-grid--six{grid-template-columns:repeat(3,minmax(0,1fr))}.quick-vacation-receipt-columns{grid-template-columns:1fr}}
@media(max-width:900px){.quick-vacation-scope-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-vacation-tax-grid--six{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:575.98px){.quick-vacation-scope-tabs,.quick-vacation-tax-grid--six{grid-template-columns:1fr}.quick-memory-cell{min-width:190px}.quick-vacation-tax-toolbar{justify-content:stretch}.quick-vacation-tax-toggle{width:100%;border-radius:12px}}

/* r43 — seletor de competência simplificado: somente mês e ano */
.competence-modal--month-year .modal-dialog{max-width:min(680px,calc(100vw - 1rem))}
.competence-topband--single{grid-template-columns:1fr}
.competence-topband--single>div{padding:.9rem 1rem}
.competence-summary-row--single{grid-template-columns:44px minmax(0,1fr) 44px}
.competence-toolbar--compact{justify-content:flex-end;margin:.7rem 0}
.competence-picker-panel--month-year{padding:1rem;border:1px solid #d8e3f2;border-radius:20px;background:#fff}
.competence-picker-panel--month-year .competence-panel-yearhead{justify-content:center;margin-bottom:.8rem}
.competence-picker-panel--month-year .competence-month-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.competence-picker-panel--month-year .competence-year-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.competence-footer-bar--compact{margin-top:.85rem}
@media(max-width:640px){
  .competence-picker-panel--month-year .competence-month-grid,
  .competence-picker-panel--month-year .competence-year-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .competence-footer-bar--compact{align-items:stretch}
}

/* ===== r44 — Design System da Calculadora: hierarquia, bordas semânticas e seis visões de férias ===== */
.quick-calculator-page{
  --quick-accent-blue:#2563eb;
  --quick-accent-cyan:#087f8c;
  --quick-accent-green:#15803d;
  --quick-accent-purple:#6d3dd1;
  --quick-accent-amber:#b45309;
  --quick-accent-red:#b4233d;
  --quick-text-strong:#173a61;
  --quick-text-muted:#667789;
}

/* Cards com a mesma leitura visual dos demais módulos. */
.quick-calculator-page .quick-entry-mode-card{border-top:3px solid var(--quick-accent-blue)!important}
.quick-calculator-page .quick-upload-panel{border-top:3px solid var(--quick-accent-cyan)!important}
.quick-calculator-page .quick-tab-shell{border-top:3px solid var(--quick-accent-purple)!important}
.quick-calculator-page .quick-param-card,
.quick-calculator-page .quick-input-card,
.quick-calculator-page .hour-input-card,
.quick-calculator-page .quick-upload-actions,
.quick-calculator-page .quick-upload-context{
  border-color:#d9e4ef!important;
  border-top:3px solid var(--quick-accent-blue)!important;
  box-shadow:0 5px 16px rgba(31,65,110,.045);
}
.quick-calculator-page .quick-param-card:nth-child(2n),
.quick-calculator-page .hour-input-card:nth-child(2n){border-top-color:var(--quick-accent-cyan)!important}
.quick-calculator-page .quick-summary-card{
  border-color:#d8e8de!important;
  border-top:3px solid var(--quick-accent-green)!important;
  box-shadow:0 4px 14px rgba(21,128,61,.045);
}
.quick-calculator-page .quick-summary-card.quick-summary-negative{border-top-color:var(--quick-accent-red)!important}
.quick-calculator-page .quick-summary-card.quick-summary-total{border-top-color:var(--quick-accent-blue)!important}
.quick-calculator-page .quick-summary-card.quick-summary-selected{border-top-color:var(--quick-accent-purple)!important}
.quick-calculator-page .quick-vacation-family,
.quick-calculator-page .quick-vacation-summary>div,
.quick-calculator-page .quick-vacation-receipt-column,
.quick-calculator-page .quick-vacation-memory-pane{
  border-top:3px solid var(--quick-accent-purple)!important;
}
.quick-calculator-page .quick-vacation-receipt-column.is-discount,
.quick-calculator-page .quick-vacation-tax-pane{border-top:3px solid var(--quick-accent-red)!important}
.quick-calculator-page .quick-vacation-receipt-column.is-provent{border-top-color:var(--quick-accent-green)!important}

/* Tipografia numérica tabular e metadados mais leves. */
.quick-calculator-page input[type="number"],
.quick-calculator-page .text-end,
.quick-calculator-page table td,
.quick-calculator-page .quick-summary-card strong,
.quick-calculator-page .quick-vacation-summary strong,
.quick-calculator-page .quick-vacation-tax-families em,
.quick-calculator-page .quick-vacation-receipt-column-head>strong,
.quick-calculator-page .quick-vacation-receipt-totals strong{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}
.quick-calculator-page .quick-summary-label,
.quick-calculator-page .quick-vacation-family small,
.quick-calculator-page .quick-context-heading p,
.quick-calculator-page .quick-vacation-competence-tab small{color:var(--quick-text-muted)}

/* Abas da simulação: seis destinos claros e responsivos. */
.quick-vacation-scope-tabs{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.quick-vacation-scope-tabs .quick-vacation-competence-tab{
  min-height:76px;
  align-content:center;
  border-width:1px;
  transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.quick-vacation-scope-tabs .quick-vacation-competence-tab:hover{transform:translateY(-1px)}
.quick-vacation-scope-tabs .is-discounts .material-icons-round{color:var(--quick-accent-red)}
.quick-vacation-scope-tabs .is-discounts.is-active{border-color:#e4aeb8;background:#fff4f6;color:#8f1730;box-shadow:inset 0 0 0 1px rgba(180,35,61,.08)}
.quick-vacation-scope-tabs .is-memory .material-icons-round{color:var(--quick-accent-purple)}
.quick-vacation-scope-tabs .is-memory.is-active{border-color:#cdbbf3;background:#f8f5ff;color:#5b2aa8;box-shadow:inset 0 0 0 1px rgba(109,61,209,.08)}

/* Painéis novos — sem expander: cada assunto ocupa sua própria aba. */
.quick-vacation-tax-pane,
.quick-vacation-memory-pane{
  margin-top:10px;
  overflow:hidden;
  border:1px solid #dfe6ee;
  border-radius:16px;
  background:#fff;
  box-shadow:0 6px 18px rgba(15,23,42,.035);
}
.quick-context-heading{
  display:flex;
  align-items:center;
  gap:10px;
  padding:13px 14px;
  border-bottom:1px solid #e7ebf0;
  background:#f8fafc;
}
.quick-context-heading--discounts{background:#fff7f8;border-bottom-color:#eed8dc}
.quick-context-heading--memory{background:#f8f5ff;border-bottom-color:#e4daf8}
.quick-context-heading__icon{
  width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;
  border-radius:12px;background:#fff;border:1px solid #e3e9ef;color:var(--quick-accent-blue);
}
.quick-context-heading--discounts .quick-context-heading__icon{color:var(--quick-accent-red);border-color:#f0d4d9}
.quick-context-heading--memory .quick-context-heading__icon{color:var(--quick-accent-purple);border-color:#ddd1f5}
.quick-context-heading>div{min-width:0;flex:1}
.quick-context-heading h3{display:flex;align-items:center;gap:4px;margin:1px 0 2px;color:var(--quick-text-strong);font-size:.86rem;font-weight:800}
.quick-context-heading p{margin:0;font-size:.62rem;line-height:1.45}
.quick-context-heading .quick-kicker{font-size:.54rem;letter-spacing:.075em;color:#718096}
.quick-formula-list--tab{padding:12px 14px 14px;background:#fff}

.quick-semantic-badge{display:inline-flex!important;align-items:center;gap:4px;padding:.42rem .62rem!important;font-size:.58rem!important;font-weight:800!important;white-space:nowrap}
.quick-semantic-badge .material-icons-round{font-size:14px!important}
.quick-semantic-badge--neutral{color:#8f1730!important;background:#fff!important;border:1px solid #efc8d0!important}
.quick-semantic-badge--info{color:#5b2aa8!important;background:#fff!important;border:1px solid #d9c9f6!important}
.quick-label-icon{font-size:14px!important;vertical-align:-2px;margin-right:3px;color:#52677d}

/* Estados, contexto e foco acessível. */
.quick-card-status,
.quick-vacation-status,
.quick-upload-panel .header-pill{font-weight:800;letter-spacing:.005em}
.quick-card-status::before{content:"event_available";font-family:"Material Icons Round";font-size:15px;vertical-align:-3px;margin-right:4px;color:var(--quick-accent-blue)}
.quick-calculator-page button:focus-visible,
.quick-calculator-page [role="tab"]:focus-visible,
.quick-calculator-page .quick-memory-info:focus-visible,
.quick-calculator-page .quick-upload-drop:focus-visible,
.quick-calculator-page input:focus-visible,
.quick-calculator-page select:focus-visible{
  outline:3px solid rgba(37,99,235,.32)!important;
  outline-offset:2px!important;
}

@media(max-width:1250px){.quick-vacation-scope-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
  .quick-vacation-scope-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-context-heading{align-items:flex-start;flex-wrap:wrap}
  .quick-context-heading .quick-semantic-badge{margin-left:48px}
}
@media(max-width:480px){.quick-vacation-scope-tabs{grid-template-columns:1fr}.quick-context-heading .quick-semantic-badge{margin-left:0}}

/* r44 — microcomponentes de leitura contextual */
.quick-row-badge{
  display:inline-flex;align-items:center;gap:3px;margin:.22rem 0 .08rem .36rem;padding:.16rem .42rem;
  border:1px solid #d9e2ec;border-radius:999px;background:#f8fafc;color:#52677d;
  font-size:.54rem;font-weight:800;line-height:1.2;vertical-align:middle;white-space:nowrap;
}
.quick-row-badge .material-icons-round{font-size:12px!important}
.quick-row-badge--vacation{border-color:#d9c9f6;background:#f8f5ff;color:#5b2aa8}
.quick-row-badge--provent,.quick-row-badge--success{border-color:#bfe2cf;background:#f1faf5;color:#166534}
.quick-row-badge--discount{border-color:#efc8d0;background:#fff4f6;color:#991b35}
.quick-formula-item--didactic{display:grid;gap:8px;padding:11px 12px!important;border-left:3px solid var(--quick-accent-purple)!important;background:#fff!important}
.quick-formula-item--didactic.quick-formula-negative{border-left-color:var(--quick-accent-red)!important;background:#fffafb!important}
.quick-formula-item--closing{border-left:3px solid var(--quick-accent-green)!important;background:#f7fcf9!important}
.quick-formula-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.quick-formula-item-head strong{min-width:0;color:#243b53;font-size:.68rem;line-height:1.35}
.quick-formula-item-head strong small{font-size:.56rem;color:#718096;font-weight:700}
.quick-formula-steps{display:grid;grid-template-columns:minmax(120px,.65fr) minmax(220px,1.8fr) minmax(120px,.65fr);gap:7px}
.quick-formula-steps>span{display:grid;gap:2px;padding:7px 8px;border:1px solid #e4eaf0;border-radius:10px;background:#fbfcfe;color:#4a5f73;font-size:.59rem;line-height:1.38;overflow-wrap:anywhere}
.quick-formula-steps b{color:#6a7888;font-size:.51rem;text-transform:uppercase;letter-spacing:.045em}
.quick-formula-item--didactic>p,.quick-formula-item--closing>p{margin:0;color:#667789;font-size:.58rem;line-height:1.45}
@media(max-width:780px){.quick-formula-steps{grid-template-columns:1fr}.quick-formula-item-head{flex-direction:column}.quick-row-badge{margin-left:0}}
