: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.1.0 — Ajuste de Divisor ===== */
.divisor-title-card { display:flex; align-items:center; gap:.7rem; }
.section-kicker { color:#075985; font-size:.68rem; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.divisor-controls { padding:1rem 1.1rem; }
.divisor-controls__grid { display:grid; grid-template-columns:minmax(340px,1fr) auto; gap:1rem; align-items:end; }
.direction-toggle { margin-top:.45rem; display:grid; grid-template-columns:1fr 60px 1fr; align-items:center; gap:.6rem; max-width:620px; padding:.65rem .8rem; border:1px solid #d8e3ec; border-radius:16px; background:#f8fbfd; }
.direction-side { display:grid; gap:.08rem; }
.direction-side small { color:#64748b; font-size:.66rem; font-weight:700; }
.direction-side strong { color:#0f172a; font-size:1.02rem; }
.direction-switch { display:grid; place-items:center; }
.direction-switch .form-check-input { width:3.1rem; height:1.55rem; margin:0; cursor:pointer; }
.factor-line { margin-top:.45rem; display:flex; align-items:center; gap:.35rem; color:#52657d; font-size:.72rem; font-weight:650; }
.factor-line .material-icons-round { font-size:17px!important; }
.upload-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
.drop-zone { min-height:74px; display:flex; align-items:center; justify-content:center; gap:.8rem; padding:.8rem 1rem; border:1px dashed #9fc5da; border-radius:15px; background:#f8fcff; color:#31566f; cursor:pointer; transition:.15s ease; }
.drop-zone:hover,.drop-zone.is-dragging,.drop-zone:focus-visible { border-color:#0284c7; background:#eff9ff; outline:none; }
.drop-zone>.material-icons-round { font-size:28px!important; }
.drop-zone div { display:grid; gap:.1rem; }
.drop-zone strong { font-size:.8rem; }
.drop-zone small { color:#718096; font-size:.69rem; }
.rule-note { display:flex; align-items:flex-start; gap:.55rem; padding:.65rem .75rem; border:1px solid #fde1b9; border-radius:13px; background:#fffaf2; color:#6f541d; font-size:.72rem; line-height:1.45; }
.rule-note .material-icons-round { flex:0 0 auto; font-size:18px!important; }
.summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.7rem; }
.summary-grid .summary-card { min-height:84px; padding:.8rem .9rem; gap:.7rem; border-radius:14px; background:#fff; }
.summary-grid .summary-card>.material-icons-round { width:34px; height:34px; display:grid; place-items:center; flex:0 0 34px; border-radius:10px; background:#f4f8fb; font-size:19px!important; }
.summary-grid .summary-card small { font-size:.66rem; }
.summary-grid .summary-card strong { font-size:1rem; }
.results-panel { padding:1rem 1.1rem; }
.results-toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; }
.results-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:.45rem; }
.search-box { width:min(270px,100%); }
.search-box .input-group-text .material-icons-round { font-size:17px!important; }
.filter-select { width:170px; }
.file-status { color:#64748b; font-size:.72rem; }
.result-table-wrap { max-height:56vh; border:1px solid #e1e8ef; border-radius:14px; overflow:auto; }
.result-table { font-size:.78rem; }
.result-table thead th { position:sticky; top:0; z-index:3; background:#eef5f9; color:#41566a; font-size:.65rem; letter-spacing:.04em; text-transform:uppercase; white-space:nowrap; }
.result-table tbody td { border-color:#edf1f4; }
.result-table tbody tr:hover { background:#f8fbfd; }
.result-table .adjust-col { width:74px; text-align:center; }
.result-table .form-check-input { min-height:0; width:1.05rem; height:1.05rem; margin:0; cursor:pointer; }
.result-table td:nth-child(2) { min-width:280px; font-weight:650; color:#334155; }
.result-table td:nth-child(n+3) { min-width:120px; font-variant-numeric:tabular-nums; }
.row-maintained { opacity:.72; }
.money-received { color:#111827!important; font-weight:750; }
.money-correct { color:#1d4ed8!important; font-weight:800; }
.diff-positive { color:#1d4ed8!important; font-weight:850; }
.diff-neutral { color:#111827!important; font-weight:750; }
.diff-negative { color:#dc2626!important; font-weight:850; }
.empty-state { min-height:200px; display:grid; place-items:center; align-content:center; gap:.22rem; color:#728096; text-align:center; }
.empty-state .material-icons-round { font-size:31px!important; color:#94a3b8; }
.empty-state strong { color:#52657d; font-size:.82rem; }
.empty-state small { font-size:.7rem; }
.legend-row { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; color:#64748b; font-size:.68rem; }
.legend-row small { margin-left:auto; }
.legend-dot { width:8px; height:8px; display:inline-block; margin-right:.3rem; border-radius:50%; }
.legend-blue { background:#1d4ed8; }.legend-black { background:#111827; }.legend-red { background:#dc2626; }
@media(max-width:1100px){.divisor-controls__grid{grid-template-columns:1fr}.upload-actions{justify-content:flex-start}.summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.results-toolbar{align-items:stretch;flex-direction:column}.results-actions{justify-content:flex-start}}
@media(max-width:767.98px){.direction-toggle{grid-template-columns:1fr 48px 1fr;padding:.55rem}.direction-side strong{font-size:.9rem}.upload-actions>*{flex:1 1 auto}.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.results-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.search-box,.filter-select{width:100%}.results-actions .btn-group,.results-actions>#btnExport{width:100%}.results-actions>#btnExport{justify-content:center}.result-table td:nth-child(2){min-width:220px}.legend-row small{width:100%;margin-left:0}}

/* ===== v4.3.0 — precisão por referência, férias e reflexos ===== */
.base-memory-panel,
.month-overview-panel { padding: 1rem 1.1rem; }
.base-memory-grid { display:grid; grid-template-columns:repeat(3,minmax(130px,1fr)); gap:.55rem; min-width:min(100%,560px); }
.base-memory-grid>div { padding:.65rem .75rem; border:1px solid #e1e8ef; border-radius:12px; background:#f8fbfd; }
.base-memory-grid small { display:block; color:#64748b; font-size:.65rem; font-weight:700; }
.base-memory-grid strong { display:block; margin-top:.12rem; color:#173a61; font-size:.92rem; font-variant-numeric:tabular-nums; }
.memory-explanation { display:flex; gap:.55rem; align-items:flex-start; padding:.7rem .8rem; border:1px solid #cfe6f4; border-radius:13px; background:#f4fbff; color:#456274; font-size:.72rem; line-height:1.5; }
.memory-explanation .material-icons-round { flex:0 0 auto; font-size:18px!important; }
.export-actions { display:flex; flex-wrap:wrap; gap:.45rem; }
.month-overview-wrap { border:1px solid #e1e8ef; border-radius:14px; overflow:auto; max-height:360px; }
.month-overview-table { font-size:.76rem; }
.month-overview-table thead th { position:sticky; top:0; z-index:2; background:#eef5f9; color:#41566a; font-size:.64rem; letter-spacing:.04em; text-transform:uppercase; white-space:nowrap; }
.month-overview-table tbody td { border-color:#edf1f4; font-variant-numeric:tabular-nums; }
.month-overview-row { cursor:pointer; }
.month-overview-row:hover,.month-overview-row.is-active { background:#f0f8fd; }
.month-link { border:0; background:transparent; padding:0; color:#075985; font-weight:800; }
.month-tabs { display:flex; gap:.38rem; overflow-x:auto; padding:.15rem 0 .35rem; scrollbar-width:thin; }
.month-chip { flex:0 0 auto; min-height:32px; padding:.3rem .68rem; border:1px solid #d5e2eb; border-radius:999px; background:#fff; color:#52657d; font-size:.7rem; font-weight:750; }
.month-chip:hover { border-color:#7bb8d6; background:#f5fbff; }
.month-chip.is-active { border-color:#0284c7; background:#e7f6fd; color:#075985; box-shadow:0 2px 7px rgba(2,132,199,.08); }
.month-placeholder { color:#7a8797; font-size:.7rem; }
.result-table .base-col,.result-table .adjust-col { width:68px; text-align:center; }
.result-table .code-cell { width:76px; color:#64748b; font-weight:750; }
.result-table td:nth-child(4) { min-width:250px; }
.result-table td:nth-child(n+5):nth-child(-n+7) { min-width:120px; font-variant-numeric:tabular-nums; }
.result-table td:nth-child(8) { min-width:92px; color:#64748b; font-variant-numeric:tabular-nums; }
.description-stack { display:flex; align-items:center; flex-wrap:wrap; gap:.38rem; }
.role-badge { display:inline-flex; align-items:center; min-height:20px; padding:.14rem .42rem; border-radius:999px; font-size:.58rem; font-weight:800; white-space:nowrap; }
.role-base { background:#ecfdf5; color:#047857; }
.role-explicit { background:#e8f5ee; color:#166534; }
.role-adjust { background:#eff6ff; color:#1d4ed8; }
.role-both { background:#f3e8ff; color:#7e22ce; }
.role-maintained { background:#f1f5f9; color:#64748b; }
.explicit-base-icon { color:#15803d; font-size:19px!important; vertical-align:middle; }
.result-table .row-base-toggle,.result-table .row-adjust-toggle { min-height:0; width:1.03rem; height:1.03rem; margin:0; cursor:pointer; }
@media(max-width:1100px){.base-memory-panel .results-toolbar{align-items:stretch!important;flex-direction:column}.base-memory-grid{min-width:0;width:100%}}
@media(max-width:767.98px){.base-memory-grid{grid-template-columns:1fr}.export-actions{width:100%}.export-actions .btn{flex:1 1 auto}.month-overview-table td,.month-overview-table th{min-width:118px}.month-overview-table td:first-child,.month-overview-table th:first-child{min-width:95px}.result-table td:nth-child(4){min-width:220px}}

/* ===== v4.4.0 — importação mais compacta + expanders ===== */
.divisor-controls-card .card-body { padding: .9rem !important; }
.divisor-import-layout {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(280px, 1fr);
  gap: .8rem;
  align-items: end;
}
.direction-compact-panel,
.upload-compact-panel {
  min-width: 0;
  padding: .72rem .78rem;
  border: 1px solid #e0e8f1;
  border-radius: 13px;
  background: #fbfdff;
}
.direction-toggle--compact {
  margin-top: .3rem;
  grid-template-columns: 1fr 44px 1fr;
  max-width: 350px;
  padding: .38rem .5rem;
  border-radius: 12px;
  background: #fff;
}
.direction-toggle--compact .direction-side small { font-size: .6rem; }
.direction-toggle--compact .direction-side strong { font-size: .9rem; }
.direction-switch-clean { display: grid; place-items: center; margin: 0; cursor: pointer; }
.direction-switch-clean input { position: absolute; opacity: 0; pointer-events: none; }
.direction-switch-clean__track {
  width: 38px;
  height: 22px;
  padding: 2px;
  display: block;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e2e8f0;
  transition: .18s ease;
}
.direction-switch-clean__track span {
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.18);
  transition: transform .18s ease;
}
.direction-switch-clean input:checked + .direction-switch-clean__track { background: #0ea5e9; border-color: #0ea5e9; }
.direction-switch-clean input:checked + .direction-switch-clean__track span { transform: translateX(16px); }
.direction-switch-clean input:focus-visible + .direction-switch-clean__track { outline: 3px solid rgba(14,165,233,.18); outline-offset: 2px; }
.upload-actions--compact { justify-content: flex-start; margin-top: .35rem; }
.employee-filter {
  display: grid;
  grid-template-columns: minmax(120px, .45fr) minmax(220px, 1fr);
  align-items: center;
  gap: .35rem .7rem;
  padding: .65rem .75rem;
  border: 1px solid #dbe6ef;
  border-radius: 12px;
  background: #f8fbfd;
}
.employee-filter > small { grid-column: 2; color: #64748b; font-size: .66rem; }
.base-memory-panel { padding: .15rem 0 0; }
.results-panel { padding: 0 !important; }
.results-panel > .card-body { padding: .9rem !important; }
.result-table .meta-matricula { min-width: 110px; color: #475569; font-weight: 750; }
.result-table .meta-name { min-width: 190px; color: #334155; font-weight: 700; }
@media (max-width: 900px) {
  .divisor-import-layout { grid-template-columns: 1fr; }
  .direction-toggle--compact { max-width: none; }
  .employee-filter { grid-template-columns: 1fr; }
  .employee-filter > small { grid-column: 1; }
}
.result-table .description-cell { min-width: 250px; font-weight: 650; color: #334155; }


/* ===== v4.4.2 — reorganização dos expanders do Ajuste de Divisor ===== */
.divisor-config-grid {
  display:grid;
  grid-template-columns:minmax(280px, 360px) minmax(420px, 1fr);
  gap:.9rem;
  align-items:stretch;
}
.planilha-header-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.75rem;
}
.panel-subtext {
  display:block;
  margin-top:.15rem;
  color:#64748b;
  font-size:.68rem;
}
.export-actions--top {
  justify-content:flex-end;
  align-items:center;
}
.direction-footnote {
  margin-top:.55rem;
  color:#64748b;
  font-size:.68rem;
  line-height:1.45;
}
.summary-grid--compact {
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.summary-grid--compact .summary-card { min-height:78px; }
.summary-card--emphasis {
  border:1px solid #ddd6fe;
  background:#faf5ff !important;
}
.base-memory-heading { display:flex; justify-content:space-between; gap:.8rem; align-items:flex-start; }
.base-core-grid {
  display:grid;
  grid-template-columns:minmax(240px,1.2fr) repeat(2,minmax(150px,.7fr));
  gap:.7rem;
}
.base-core-card {
  min-width:0;
  padding:.8rem .9rem;
  border:1px solid #dbe6ef;
  border-radius:13px;
  background:#f8fbfd;
}
.base-core-card small {
  display:block;
  color:#64748b;
  font-size:.67rem;
  font-weight:800;
}
.base-core-card strong {
  display:block;
  margin-top:.16rem;
  color:#173a61;
  font-size:1.05rem;
  font-variant-numeric:tabular-nums;
}
.base-core-card--wide {
  background:#fff;
  border-color:#cfe0ec;
}
.base-inline-formula {
  display:block;
  margin-top:.3rem;
  color:#64748b;
  font-size:.67rem;
  line-height:1.45;
}
.month-overview-wrap { max-height:none; }
.month-overview-table td,
.month-overview-table th { vertical-align:middle; }
.month-overview-table tbody td:first-child { font-weight:800; color:#075985; }
@media (max-width: 1100px) {
  .divisor-config-grid { grid-template-columns:1fr; }
  .summary-grid--compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .planilha-header-row { flex-direction:column; align-items:stretch; }
  .export-actions--top { justify-content:flex-start; }
  .base-core-grid { grid-template-columns:1fr; }
}
@media (max-width: 767.98px) {
  .summary-grid--compact { grid-template-columns:1fr; }
  .export-actions--top { width:100%; }
  .export-actions--top .btn { flex:1 1 auto; }
}


/* ===== v4.4.3 — página Divisor compacta, 2 colunas e resultados alternáveis ===== */
.divisor-primary-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:.8rem;
  align-items:start;
}
.divisor-primary-grid > .app-card { margin-top:0 !important; min-width:0; }
.divisor-primary-grid .card-body { padding:.8rem !important; }
.direction-mini-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.7rem;
  padding:.62rem .7rem;
  border:1px solid #dce6ee;
  border-radius:12px;
  background:#fbfdff;
}
.direction-mini-control { display:flex; align-items:center; gap:.55rem; flex:0 0 auto; }
.direction-badge {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:.28rem .58rem;
  border:1px solid #cfe0ec;
  border-radius:999px;
  background:#f7fbfd;
  color:#173a61;
  font-size:.72rem;
  font-weight:850;
  font-variant-numeric:tabular-nums;
}
.planilha-compact-box {
  padding:.68rem .72rem;
  border:1px solid #dce6ee;
  border-radius:12px;
  background:#fff;
}
.planilha-action-grid { display:flex; flex-wrap:wrap; gap:.36rem; }
.action-ghost-btn {
  display:inline-flex;
  align-items:center;
  gap:.32rem;
  min-height:31px;
  padding:.3rem .55rem;
  border:1px solid #d4dee7;
  border-radius:9px;
  background:transparent !important;
  color:#41566a;
  font-size:.72rem;
  font-weight:750;
}
.action-ghost-btn:hover:not(:disabled), .action-ghost-btn:focus-visible { border-color:#7bb8d6; background:#f7fbfd !important; color:#075985; }
.action-ghost-btn:disabled { opacity:.42; }
.action-ghost-btn .material-icons-round { font-size:17px !important; }
.drop-zone--compact { min-height:58px; padding:.55rem .7rem; border-radius:11px; }
.drop-zone--compact>.material-icons-round { font-size:22px !important; }
.drop-zone--compact strong { font-size:.73rem; }
.drop-zone--compact small { font-size:.64rem; }
.rule-note--compact { padding:.52rem .62rem; font-size:.67rem; border-radius:11px; }
.summary-mini-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.summary-mini-card {
  min-width:0;
  min-height:62px;
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.58rem .62rem;
  border:1px solid #dce6ee;
  border-radius:11px;
  background:#fff;
}
.summary-mini-card>.material-icons-round {
  width:30px; height:30px; flex:0 0 30px; display:grid; place-items:center;
  border-radius:9px; background:#f4f8fb; font-size:17px !important;
}
.summary-mini-card small { display:block; color:#64748b; font-size:.62rem; font-weight:750; }
.summary-mini-card strong { display:block; margin-top:.08rem; color:#173a61; font-size:.9rem; }
.summary-mini-card--difference { background:#fbf8ff; border-color:#e5dcfb; }
.base-compact-box { padding:.62rem .68rem; border:1px solid #dce6ee; border-radius:12px; background:#fbfdff; }
.base-source-row { display:flex; align-items:flex-start; justify-content:space-between; gap:.5rem; }
.base-mini-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.45rem; }
.base-mini-grid>div { padding:.48rem .55rem; border:1px solid #e1e8ef; border-radius:9px; background:#fff; }
.base-mini-grid small { display:block; color:#64748b; font-size:.59rem; font-weight:750; }
.base-mini-grid strong { display:block; margin-top:.08rem; color:#173a61; font-size:.82rem; font-variant-numeric:tabular-nums; }
.base-formula-line { display:flex; align-items:flex-start; gap:.4rem; color:#52657d; font-size:.64rem; line-height:1.4; }
.base-formula-line .material-icons-round { flex:0 0 auto; font-size:16px !important; }
.results-switch-header { align-items:center !important; }
.result-view-toggle { display:inline-flex; gap:.18rem; padding:.2rem; border:1px solid #d8e3ec; border-radius:10px; background:#f8fbfd; }
.result-view-btn { display:inline-flex; align-items:center; gap:.28rem; min-height:30px; padding:.28rem .5rem; border:0; border-radius:7px; color:#52657d; font-size:.68rem; font-weight:800; }
.result-view-btn .material-icons-round { font-size:16px !important; }
.result-view-btn:hover { background:#eef6fb; color:#075985; }
.result-view-btn.is-active { background:#fff; color:#075985; box-shadow:0 1px 5px rgba(15,23,42,.08); }
.detail-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.7rem; }
.detail-file-status { min-width:0; flex:1 1 auto; color:#64748b; font-size:.68rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.results-panel>.card-body { padding:.8rem !important; }
.month-overview-wrap { max-height:none; border-radius:11px; }
.month-overview-table { font-size:.72rem; }
.result-table-wrap { border-radius:11px; }
@media(max-width:1199.98px){
  .divisor-primary-grid { grid-template-columns:1fr; }
}
@media(max-width:767.98px){
  .direction-mini-row { align-items:flex-start; flex-direction:column; }
  .direction-mini-control { width:100%; justify-content:space-between; }
  .summary-mini-grid { grid-template-columns:1fr; }
  .base-mini-grid { grid-template-columns:1fr; }
  .results-switch-header { align-items:flex-start !important; }
  .result-view-toggle { width:100%; }
  .result-view-btn { flex:1 1 50%; justify-content:center; }
  .detail-toolbar { align-items:stretch; flex-direction:column; }
  .detail-file-status { white-space:normal; }
}


/* ===== v4.4.6 — quatro sentidos + edição no detalhamento ===== */
.direction-mini-row--editable { align-items:center; }
.direction-editor { display:flex; align-items:flex-end; justify-content:flex-end; gap:.38rem; flex-wrap:wrap; }
.direction-editor label { display:grid; gap:.14rem; margin:0; }
.direction-editor label>span { color:#64748b; font-size:.56rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.direction-editor .form-select { width:84px; min-height:30px; padding-top:.2rem; padding-bottom:.2rem; font-size:.7rem; font-weight:800; }
.direction-arrow { align-self:center; margin-top:.8rem; color:#f97316; font-size:18px!important; }
.summary-mini-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.summary-mini-card--month { border-color:#cfe3f8; background:#f7fbff; }
.table-head-info { margin-left:.18rem; color:#64748b; font-size:13px!important; vertical-align:middle; cursor:help; }
.editable-money-cell { display:inline-grid; grid-template-columns:auto minmax(76px,96px); align-items:center; overflow:hidden; border:1px solid transparent; border-radius:8px; background:transparent; }
.editable-money-cell>span { padding-left:.35rem; color:#64748b; font-size:.62rem; font-weight:750; }
.table-money-input { width:100%; min-height:28px; padding:.18rem .35rem; border:0; outline:0; background:transparent; color:inherit; font:inherit; font-weight:800; text-align:right; font-variant-numeric:tabular-nums; }
.editable-money-cell:hover,.editable-money-cell:focus-within { border-color:#b8d7ec; background:#fff; box-shadow:0 0 0 2px rgba(14,165,233,.07); }
.editable-money-cell.is-manual { border-color:#c4b5fd; background:#faf5ff; }
.editable-money-cell.is-manual::after { content:'manual'; position:absolute; opacity:0; pointer-events:none; }
@media(max-width:900px){.direction-mini-row--editable{align-items:flex-start}.direction-editor{justify-content:flex-start}.summary-mini-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.direction-editor{width:100%;display:grid;grid-template-columns:1fr auto 1fr;align-items:end}.direction-editor label .form-select{width:100%}.direction-badge{grid-column:1/-1;justify-self:start}.summary-mini-grid{grid-template-columns:1fr}.editable-money-cell{grid-template-columns:auto minmax(72px,1fr)}}


/* ===== v4.4.7 — BASE SAL. selecionável ===== */
.result-table .row-explicit-base-toggle {
  border-color:#86cdb1;
  box-shadow:0 0 0 2px rgba(16,185,129,.04);
}
.result-table .row-explicit-base-toggle:checked {
  background-color:#10b981;
  border-color:#10b981;
}
.result-table .row-explicit-base-toggle:focus {
  border-color:#10b981;
  box-shadow:0 0 0 .18rem rgba(16,185,129,.15);
}

/* ===== v4.4.8 — composição da base + estados ===== */
.role-base-disabled { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.base-source-disabled { color:#b91c1c !important; font-weight:800; }
.base-composition {
  padding:.52rem .58rem;
  border:1px dashed #d6e2ec;
  border-radius:10px;
  background:#fff;
}
.base-composition-head {
  display:flex; align-items:center; justify-content:space-between; gap:.45rem; flex-wrap:wrap;
  color:#52657d; font-size:.61rem; font-weight:800; text-transform:uppercase; letter-spacing:.035em;
}
.base-composition-status {
  display:inline-flex; align-items:center; gap:.22rem; min-height:22px; padding:.16rem .42rem;
  border-radius:999px; font-size:.57rem; font-weight:850; letter-spacing:0; text-transform:none;
}
.base-composition-status .material-icons-round { font-size:13px!important; }
.base-composition-status.is-match { background:#ecfdf5; color:#047857; }
.base-composition-status.is-partial { background:#fff7ed; color:#c2410c; }
.base-composition-status.is-manual { background:#eff6ff; color:#1d4ed8; }
.base-composition-status.is-disabled { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.base-composition-formula { display:flex; align-items:center; gap:.32rem; flex-wrap:wrap; margin-top:.42rem; }
.base-component-pill {
  display:inline-flex; align-items:center; gap:.2rem; min-height:24px; padding:.2rem .4rem;
  border:1px solid #dbe6ef; border-radius:999px; background:#f8fbfd; color:#52657d;
  font-size:.59rem; white-space:nowrap;
}
.base-component-pill>strong { color:#075985; }
.base-component-pill>b { color:#173a61; font-weight:850; }
.base-composition-equals { color:#64748b; font-size:.62rem; }
.base-composition-equals strong { color:#173a61; }
.base-composition-empty { margin-top:.35rem; color:#94a3b8; font-size:.61rem; }


/* ===== v4.5.1 — diagnóstico de competência sem efeito do divisor ===== */
.summary-effect-note { margin-top:.55rem; padding:.45rem .6rem; border:1px solid #d8e5ef; border-radius:10px; background:#f8fbfd; color:#607086; font-size:.66rem; line-height:1.45; }
.summary-effect-note.is-warning { border-color:#f1d39e; background:#fff9ed; color:#8a5b19; }

/* r42 — memória por tabela + toggles limpos no detalhamento */
.result-memory-cell{min-width:260px;max-width:440px;color:#52657d;font-size:.68rem;line-height:1.42;white-space:normal}.result-memory-cell>span{display:inline}.result-memory-info{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-left:4px;padding:0;border:0;border-radius:50%;background:transparent;color:#2563eb;vertical-align:middle}.result-memory-info:hover,.result-memory-info:focus-visible{background:#eaf2ff;outline:0}.result-memory-info .material-icons-round{font-size:16px!important}.result-table .app-toggle-icon{margin:auto}
