/* ============================================================
   Vencia — ported component styles
   Ported from components/{core,data,feedback,navigation}/*.jsx.
   Each React SIZES/VARIANTS object becomes a class here; the
   inline-style + JS-hover-state pattern becomes real :hover /
   :disabled / :focus-visible selectors against the same
   var(--token) references used in the originals.
   ============================================================ */

/* ---------- utilities ---------- */
.u-text-right { text-align: right; }
.u-text-center { text-align: center; }
.u-flex-1 { flex: 1 1 auto; min-width: 0; }

/* ---------- Icon (components/core/Icon.jsx) ---------- */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: currentColor;
}

/* ---------- Button (components/core/Button.jsx) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-control), transform var(--dur-instant) var(--ease-standard);
}
.btn--full-width { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn:focus-visible { box-shadow: var(--ring); }

.btn--sm { height: var(--control-h-sm); padding: 0 10px; font-size: var(--text-sm); gap: 6px; }
.btn--md { height: var(--control-h-md); padding: 0 14px; font-size: var(--text-sm); gap: 7px; }
.btn--lg { height: var(--control-h-lg); padding: 0 18px; font-size: var(--text-body-size); gap: 8px; }

.btn--primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inset-highlight); }
.btn--primary:not(:disabled):hover { background: var(--accent-hover); }

.btn--secondary { background: var(--surface-card); color: var(--text-strong); border: 1px solid var(--border-default); box-shadow: var(--shadow-sm); }
.btn--secondary:not(:disabled):hover { background: var(--surface-hover); }

.btn--ghost { background: transparent; color: var(--text-body); border: 1px solid transparent; }
.btn--ghost:not(:disabled):hover { background: var(--surface-hover); }

.btn--danger { background: var(--red-600); color: var(--on-danger); border: 1px solid var(--red-600); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inset-highlight); }
.btn--danger:not(:disabled):hover { background: var(--red-700); }

.btn--quiet { background: var(--surface-sunken); color: var(--text-strong); border: 1px solid transparent; }
.btn--quiet:not(:disabled):hover { background: var(--surface-active); }

/* Utility for a ghost button/icon-button carrying a destructive meaning that
   is rarer/more final than a plain .btn--danger action next to it (e.g.
   "Cancelar serviço" next to "Suspender", or a row's delete-confirm check
   next to its edit/delete icon-buttons) — quiet red text at rest so it
   doesn't compete visually with a solid danger button, but unmistakably red
   on hover/focus so it still reads as consequential, not a neutral action. */
.action-danger-quiet { color: var(--red-600); }
.action-danger-quiet:not(:disabled):hover { background: var(--status-overdue-bg); color: var(--red-700); }

.btn__icon { flex: 0 0 auto; }

/* ---------- IconButton (components/core/IconButton.jsx) ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-control);
}
.icon-btn:disabled { cursor: not-allowed; opacity: .45; }
.icon-btn:focus-visible { box-shadow: var(--ring); }
.icon-btn--sm { width: 28px; height: 28px; }
.icon-btn--md { width: 36px; height: 36px; }
.icon-btn--lg { width: 44px; height: 44px; }
.icon-btn--ghost { background: transparent; border: 1px solid transparent; }
.icon-btn--secondary { background: var(--surface-card); border: 1px solid var(--border-default); box-shadow: var(--shadow-sm); }
.icon-btn:not(:disabled):hover { background: var(--surface-hover); color: var(--text-strong); }

/* ---------- Card (components/core/Card.jsx) ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-standard);
}
.card--interactive:hover { box-shadow: var(--shadow-raised); }
.card__header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.card__header-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card__title { font-size: var(--text-h3); letter-spacing: var(--text-h3-ls); }
.card__subtitle { font-size: var(--text-xs); color: var(--text-muted); }
.card__body { padding: 16px; flex: 1; min-height: 0; }
.card__body--flush { padding: 0; }

/* ---------- Checkbox (components/core/Checkbox.jsx) ---------- */
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.checkbox--with-description { align-items: flex-start; }
.checkbox--disabled { opacity: .5; cursor: not-allowed; }
.checkbox__input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox__box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; flex: 0 0 auto;
  border-radius: var(--radius-xs);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-control);
}
.checkbox--with-description .checkbox__box { margin-top: 2px; }
.checkbox__input:checked + .checkbox__box { background: var(--accent); border-color: var(--accent); }
.checkbox__check { display: none; }
.checkbox__input:checked + .checkbox__box .checkbox__check { display: inline-flex; }
.checkbox__input:focus-visible + .checkbox__box { box-shadow: var(--ring); }
.checkbox__text { display: flex; flex-direction: column; gap: 2px; }
.checkbox__label { font-size: var(--text-sm); color: var(--text-strong); }
.checkbox__description { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- Switch (components/core/Switch.jsx) ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch--disabled { opacity: .5; cursor: not-allowed; }
.switch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative; width: 36px; height: 21px; flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--border-default);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.switch__input:checked + .switch__track { background: var(--accent); }
.switch__input:focus-visible + .switch__track { box-shadow: var(--ring); }
.switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--on-accent);
  box-shadow: var(--shadow-sm);
  transition: left var(--dur-fast) var(--ease-standard);
}
.switch__input:checked + .switch__track .switch__thumb { left: 17px; }
.switch__label { font-size: var(--text-sm); color: var(--text-strong); }

/* ---------- Input / Select / Textarea (components/core/{Input,Select,Textarea}.jsx) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-strong); }
.field__hint { font-size: var(--text-xs); color: var(--text-muted); }
.field__hint--error { color: var(--red-600); }

.field__control {
  display: flex; align-items: center; gap: 8px;
  height: var(--control-h-md);
  padding: 0 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-control);
}
.field__control--sm { height: var(--control-h-sm); }
.field__control--lg { height: var(--control-h-lg); }
.field__control:focus-within { border-color: var(--border-focus); box-shadow: var(--ring); }
/* The control draws the focus ring; without this the global :focus-visible ring drew a second box inside it. */
.field__input:focus-visible { box-shadow: none; }
.field__control--error, .field__control--error:focus-within { border-color: var(--red-600); }

.field__input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font: inherit; font-size: var(--text-sm); color: var(--text-strong);
}
.field__suffix { font-size: var(--text-sm); color: var(--text-muted); white-space: nowrap; }

.field__select-wrap { position: relative; display: flex; align-items: center; }
.field__select {
  appearance: none;
  width: 100%;
  height: var(--control-h-md);
  padding: 0 30px 0 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font: inherit; font-size: var(--text-sm); color: var(--text-strong);
  cursor: pointer;
  transition: var(--transition-control);
}
.field__select:focus-visible { border-color: var(--border-focus); box-shadow: var(--ring); }
.field__select-chevron { position: absolute; right: 9px; pointer-events: none; }

.field__textarea {
  resize: vertical;
  padding: 8px 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  outline: none;
  font: inherit; font-size: var(--text-sm); line-height: 1.5; color: var(--text-strong);
  transition: var(--transition-control);
}
.field__textarea:focus { border-color: var(--border-focus); box-shadow: var(--ring); }
.field__textarea--error, .field__textarea--error:focus { border-color: var(--red-600); }

/* ---------- SearchInput (components/core/SearchInput.jsx) ---------- */
.search-input {
  display: flex; align-items: center; gap: 8px;
  height: var(--control-h-md);
  padding: 0 10px;
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: var(--transition-control);
}
.search-input:focus-within { background: var(--surface-card); border-color: var(--border-focus); box-shadow: var(--ring); }
.search-input__input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: var(--text-sm); color: var(--text-strong); }
.search-input__kbd { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); padding: 1px 5px; }

/* ---------- GlobalSearch (Fase 7 — app/Livewire/Shared/GlobalSearch.php) ---------- */
.global-search { position: relative; width: 300px; }
.global-search__panel {
  position: absolute; top: calc(100% + 6px); left: 0; width: 340px; max-height: 360px;
  overflow-y: auto; z-index: 50; padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
}
.global-search__group + .global-search__group { margin-top: 4px; }
.global-search__group-label { display: block; padding: 6px 10px 4px; font-size: var(--text-label); letter-spacing: var(--text-label-ls); text-transform: uppercase; font-weight: var(--weight-semibold); color: var(--text-muted); }
.global-search__item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-body); transition: var(--transition-control); }
.global-search__item:hover { background: var(--surface-hover); }
.global-search__item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.global-search__item-title { font-size: var(--text-sm); color: var(--text-strong); font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search__item-sub { font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search__avatar { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--text-accent); font-size: 11px; font-weight: var(--weight-semibold); }
.global-search__empty { padding: 14px 10px; font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- LogoSlot (components/core/LogoSlot.jsx) ---------- */
.logo-slot { display: flex; align-items: center; gap: 12px; }
.logo-slot__btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; padding: 0;
  background: var(--surface-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-control);
  color: var(--text-faint);
}
.logo-slot__btn--filled { border-style: solid; border-color: var(--border-subtle); }
.logo-slot__btn:hover { background: var(--surface-hover); border-color: var(--border-accent); color: var(--accent); }
.logo-slot__img { width: 100%; height: 100%; object-fit: contain; }
.logo-slot__text { display: flex; flex-direction: column; gap: 2px; }
.logo-slot__label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-strong); }
.logo-slot__hint { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- ThemeToggle (components/core/ThemeToggle.jsx) ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-control);
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text-strong); }
.theme-toggle__icon-light { display: none; }
[data-theme="dark"] .theme-toggle__icon-dark { display: none; }
[data-theme="dark"] .theme-toggle__icon-light { display: inline-block; }

/* ---------- StatusBadge (components/feedback/StatusBadge.jsx) ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  white-space: nowrap;
}
.status-badge--sm { height: 20px; padding: 0 7px; font-size: var(--text-xs); }
.status-badge__dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }

.status-badge--activo { background: var(--status-active-bg); color: var(--status-active-fg); }
.status-badge--activo .status-badge__dot { background: var(--status-active-dot); }
.status-badge--a_vencer { background: var(--status-due-bg); color: var(--status-due-fg); }
.status-badge--a_vencer .status-badge__dot { background: var(--status-due-dot); }
.status-badge--vencido { background: var(--status-overdue-bg); color: var(--status-overdue-fg); }
.status-badge--vencido .status-badge__dot { background: var(--status-overdue-dot); }
.status-badge--suspenso { background: var(--status-suspended-bg); color: var(--status-suspended-fg); }
.status-badge--suspenso .status-badge__dot { background: var(--status-suspended-dot); }
.status-badge--cancelado { background: var(--status-cancelled-bg); color: var(--status-cancelled-fg); }
.status-badge--cancelado .status-badge__dot { background: var(--status-cancelled-dot); }

/* ---------- Tag (components/feedback/Tag.jsx) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag--neutral { background: var(--surface-sunken); color: var(--text-body); }
.tag--accent { background: var(--accent-soft); color: var(--text-accent); }
.tag--outline { background: transparent; color: var(--text-muted); border-color: var(--border-subtle); }

/* ---------- AlertBanner (components/feedback/AlertBanner.jsx) ---------- */
.alert-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid transparent; }
.alert-banner__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-banner__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.alert-banner__desc { font-size: var(--text-sm); color: var(--text-body); }
.alert-banner--info { background: var(--accent-soft); border-color: var(--accent-soft-border); color: var(--text-accent); }
.alert-banner--warning { background: var(--status-due-bg); border-color: var(--amber-100); color: var(--status-due-fg); }
.alert-banner--danger { background: var(--status-overdue-bg); border-color: var(--red-100); color: var(--status-overdue-fg); }
.alert-banner--success { background: var(--status-active-bg); border-color: var(--green-100); color: var(--status-active-fg); }

/* ---------- EmptyState (components/feedback/EmptyState.jsx) ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 24px; text-align: center; }
.empty-state__icon-wrap { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--surface-sunken); }
.empty-state__title { font-size: var(--text-h3); color: var(--text-strong); }
.empty-state__desc { margin: 0; max-width: 320px; font-size: var(--text-sm); color: var(--text-muted); }
.empty-state__action { margin-top: 6px; }

/* ---------- Toast (components/feedback/Toast.jsx) ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  width: 320px; padding: 12px 13px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
}
.toast--visible { opacity: 1; transform: translateY(0); }
.toast__icon {
  width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  background: currentColor;
}
.toast--success .toast__icon { color: var(--green-600); -webkit-mask-image: url('../icons/circle-check.svg'); mask-image: url('../icons/circle-check.svg'); }
.toast--danger .toast__icon { color: var(--red-600); -webkit-mask-image: url('../icons/circle-alert.svg'); mask-image: url('../icons/circle-alert.svg'); }
.toast--info .toast__icon { color: var(--accent); -webkit-mask-image: url('../icons/info.svg'); mask-image: url('../icons/info.svg'); }
.toast__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast__title { font-size: var(--text-sm); color: var(--text-strong); }
.toast__desc { font-size: var(--text-xs); color: var(--text-muted); }
.toast__close { cursor: pointer; color: var(--text-faint); line-height: 1; font-size: 16px; }

/* ---------- Pill picker (biblioteca strip, método picker — Fase 4) ---------- */
.pill-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-picker__item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-body);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-regular);
  cursor: pointer; white-space: nowrap;
  transition: var(--transition-control);
}
.pill-picker__item:hover { background: var(--surface-hover); }
.pill-picker__item--active { background: var(--accent-soft); border-color: var(--accent-soft-border); color: var(--text-accent); font-weight: var(--weight-medium); }
.pill-picker__item--static { cursor: default; background: var(--surface-sunken); border-color: transparent; }
.pill-picker__item--static:hover { background: var(--surface-sunken); }

/* ---------- Dialog (components/feedback/Dialog.jsx) ---------- */
.dialog-scrim {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}
.dialog-panel {
  max-width: 100%; max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
}
.dialog-panel__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 0; flex: 0 0 auto; }
.dialog-panel__head-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.dialog-panel__title { font-size: var(--text-h3); letter-spacing: var(--text-h3-ls); }
.dialog-panel__desc { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.dialog-panel__body { padding: 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.dialog-panel__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-subtle); background: var(--table-head-bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex: 0 0 auto; }

/* ---------- DataTable (components/data/DataTable.jsx) ---------- */
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  padding: 11px 14px; text-align: left;
  font-size: var(--text-label); letter-spacing: var(--text-label-ls); text-transform: uppercase;
  font-weight: var(--weight-semibold); color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  background: var(--table-head-bg);
}
.data-table td { padding: 11px 14px; text-align: left; color: var(--text-body); border-bottom: 1px solid var(--border-subtle); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table--dense th, .data-table--dense td { padding: 8px 14px; }
.data-table tbody tr[data-clickable] { cursor: pointer; transition: background-color var(--dur-instant) var(--ease-standard); }
.data-table tbody tr[data-clickable]:hover { background: var(--surface-hover); }
.data-table__th-label { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Timeline (components/data/Timeline.jsx) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.timeline__rail { display: flex; flex-direction: column; align-items: center; }
.timeline__dot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-card); border: 1px solid var(--border-subtle); }
.timeline__line { flex: 1; width: 1px; background: var(--border-subtle); min-height: 14px; }
.timeline__content { padding-bottom: 16px; display: flex; flex-direction: column; gap: 2px; }
.timeline__item--last .timeline__content { padding-bottom: 0; }
.timeline__date { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }
.timeline__title { font-size: var(--text-sm); color: var(--text-strong); font-weight: var(--weight-medium); }
.timeline__desc { font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- MoneyValue (components/data/MoneyValue.jsx) ---------- */
.money-value { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.money-value--sm { font-size: var(--text-sm); letter-spacing: -0.01em; font-weight: var(--weight-medium); }
.money-value--md { font-size: var(--text-body-size); letter-spacing: -0.01em; font-weight: var(--weight-medium); }
.money-value--lg { font-size: var(--text-h2); letter-spacing: -0.01em; font-weight: var(--weight-semibold); }
.money-value--metric { font-size: var(--text-metric); letter-spacing: var(--text-metric-ls); font-weight: var(--weight-semibold); }
.money-value--neutral { color: var(--money-neutral); }
.money-value--in { color: var(--money-in); }
.money-value--out { color: var(--money-out); }
.money-value--muted { color: var(--text-muted); }
.money-value__currency { font-size: .72em; font-weight: var(--weight-medium); color: var(--text-muted); }

/* ---------- StatCard (components/data/StatCard.jsx) ---------- */
.stat-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-standard);
}
.stat-card--clickable { cursor: pointer; }
.stat-card--clickable:hover { box-shadow: var(--shadow-raised); }
.stat-card__head { display: flex; align-items: center; gap: 8px; }
.stat-card__label { flex: 1; font-size: var(--text-label); letter-spacing: var(--text-label-ls); text-transform: uppercase; font-weight: var(--weight-semibold); color: var(--text-muted); }
.stat-card__value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--text-metric); line-height: var(--text-metric-lh); letter-spacing: var(--text-metric-ls);
  font-weight: var(--weight-semibold);
}
.stat-card__value--neutral { color: var(--text-strong); }
.stat-card__value--in { color: var(--money-in); }
.stat-card__value--out { color: var(--money-out); }
.stat-card__value--due { color: var(--status-due-fg); }
.stat-card__foot { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.stat-card__delta { font-weight: var(--weight-medium); }
.stat-card__delta--in { color: var(--money-in); }
.stat-card__delta--out { color: var(--money-out); }
.stat-card__delta--neutral { color: var(--text-muted); }

/* ---------- ServiceLogo (components/data/ServiceLogo.jsx) ---------- */
.service-logo-img { flex: 0 0 auto; object-fit: contain; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.service-logo-img--sm { border-radius: var(--radius-sm); }
.service-logo-mono {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-weight: var(--weight-semibold); letter-spacing: -0.02em;
}
.service-logo-mono--sm { border-radius: var(--radius-sm); }
.service-logo-mono__badge { position: absolute; right: -2px; bottom: -2px; background: var(--surface-card); border-radius: var(--radius-pill); padding: 2px; box-shadow: 0 0 0 1px var(--border-subtle); }

/* ---------- PaymentMethod (components/data/PaymentMethod.jsx) ---------- */
.payment-method { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.payment-method__badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: var(--radius-xs); overflow: hidden; box-shadow: 0 0 0 1px rgba(20,23,29,.07); }
.payment-method__img { width: 100%; height: 100%; object-fit: cover; }
.payment-method__label { font-size: var(--text-sm); color: var(--text-body); }

/* ---------- PageHeader (components/navigation/PageHeader.jsx) ---------- */
.page-header { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-header__main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.page-header__back { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; border: none; background: none; padding: 0; color: var(--text-muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.page-header__back:hover { color: var(--text-strong); }
.page-header__eyebrow { font-size: var(--text-label); letter-spacing: var(--text-label-ls); text-transform: uppercase; font-weight: var(--weight-semibold); color: var(--text-muted); }
.page-header__title { font-size: var(--text-h1); line-height: var(--text-h1-lh); letter-spacing: var(--text-h1-ls); }
.page-header__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-muted); }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Tabs (components/navigation/Tabs.jsx) ---------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.tabs__tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-muted);
  font: inherit; font-size: var(--text-sm);
  white-space: nowrap; cursor: pointer;
  transition: var(--transition-control);
}
.tabs__tab:hover { color: var(--text-strong); }
.tabs__tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text-strong); font-weight: var(--weight-medium); }
.tabs__count { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }

/* ---------- SidebarNav (components/navigation/SidebarNav.jsx) ---------- */
.sidebar-nav { display: flex; flex-direction: column; gap: 14px; width: var(--sidebar-w); flex: 0 0 auto; height: 100vh; position: sticky; top: 0; padding: 14px 12px; background: var(--surface-app); border-right: 1px solid var(--border-subtle); overflow-y: auto; }
.sidebar-nav__brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px; }
.sidebar-nav__logo { width: 26px; height: 26px; border-radius: var(--radius-sm); object-fit: contain; flex: 0 0 auto; }
.sidebar-nav__brand-name { flex: 1; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong); letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; }
.sidebar-nav__list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 10px;
  border: none; border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-regular);
  white-space: nowrap; cursor: pointer; text-align: left;
  transition: var(--transition-control);
}
.sidebar-nav__item:hover { background: var(--nav-hover); }
.sidebar-nav__item--active { background: var(--surface-card); box-shadow: var(--shadow-sm); color: var(--text-strong); font-weight: var(--weight-medium); }
.sidebar-nav__label { flex: 1; }
.sidebar-nav__badge { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--status-due-fg); background: var(--status-due-bg); border-radius: var(--radius-pill); padding: 1px 6px; }
.sidebar-nav__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav__footer { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-muted); }
.sidebar-nav__footer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-600); flex: 0 0 auto; }
.sidebar-nav__toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 30px; padding: 0 10px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--surface-card); color: var(--text-muted);
  font: inherit; font-size: var(--text-xs); cursor: pointer;
  transition: var(--transition-control);
}
.sidebar-nav__toggle:hover { background: var(--surface-hover); color: var(--text-strong); }
.sidebar-nav__toggle-icon--collapsed { display: none; }

/* Collapsed state: the attribute lives on <html> (see sidebar-nav.blade.php's
   comment) so it survives wire:navigate morphs without a per-page init script.
   Desktop only — on phones the sidebar is an off-canvas drawer (see below). */
@media (min-width: 861px) {
  [data-sidebar-collapsed] .sidebar-nav { width: var(--sidebar-w-collapsed, 60px); padding: 14px 8px; }
  [data-sidebar-collapsed] .sidebar-nav__brand { justify-content: center; padding: 4px 0; }
  [data-sidebar-collapsed] .sidebar-nav__brand-name,
  [data-sidebar-collapsed] .sidebar-nav__label,
  [data-sidebar-collapsed] .sidebar-nav__badge,
  [data-sidebar-collapsed] .sidebar-nav__footer,
  [data-sidebar-collapsed] .sidebar-nav__toggle-label { display: none; }
  [data-sidebar-collapsed] .sidebar-nav__item { justify-content: center; padding: 0; }
  [data-sidebar-collapsed] .sidebar-nav__toggle { justify-content: center; padding: 0; }
  [data-sidebar-collapsed] .sidebar-nav__toggle-icon--expanded { display: none; }
  [data-sidebar-collapsed] .sidebar-nav__toggle-icon--collapsed { display: inline-block; }

  /* Focus mode: the ☰ button hides the whole sidebar (html[data-sidebar-hidden]). */
  [data-sidebar-hidden] .sidebar-nav { display: none; }
}

/* The ☰ button sits in the top-left corner of the top bar on every screen:
   focus mode on a computer, drawer on a phone (html[data-nav-open]). */
.top-bar__menu { margin-left: -6px; flex: 0 0 auto; }
.top-bar__search { flex: 0 0 auto; }
.nav-scrim { display: none; }
@media (max-width: 860px) {
  :root { --gutter: 14px; }
  .sidebar-nav { position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: min(280px, 86vw); height: 100dvh; transform: translateX(-100%); visibility: hidden; transition: transform var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base); box-shadow: var(--shadow-overlay); }
  [data-nav-open] .sidebar-nav { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease-standard); }
  [data-nav-open] .nav-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: var(--scrim); }
  [data-nav-open] body { overflow: hidden; }
  .sidebar-nav__item { height: 40px; }
  .sidebar-nav__toggle { display: none; }
  .top-bar { gap: 8px; }

  .top-bar__search { flex: 1 1 auto; min-width: 0; }
  .global-search { width: 100%; }
  .top-bar__search .search-input { width: 100% !important; } /* overrides the component's inline desktop width */
  .top-bar__actions { flex: 0 0 auto; gap: 2px; }
  .search-input__kbd { display: none; }
  .app-shell__content { padding-top: 16px; }
  .page-header__main { min-width: 0; flex-basis: 100%; }
}

/* ---------- TopBar (components/navigation/TopBar.jsx) ---------- */
.top-bar { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); flex: 0 0 auto; padding: 0 var(--gutter); background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; z-index: 40; }
.top-bar__title { font-size: var(--text-h3); color: var(--text-strong); letter-spacing: var(--text-h3-ls); }
.top-bar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-bar__bell-wrap { position: relative; display: flex; }
.top-bar__badge { position: absolute; top: 4px; right: 4px; min-width: 15px; height: 15px; padding: 0 3px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); background: var(--red-600); color: var(--on-danger); font-family: var(--font-mono); font-size: 9px; font-weight: var(--weight-semibold); }
.top-bar__avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-sunken); color: var(--text-muted); overflow: hidden; flex: 0 0 auto; border: none; padding: 0; cursor: pointer; transition: var(--transition-control); }
.top-bar__avatar:hover { background: var(--surface-hover); color: var(--text-strong); }
.top-bar__avatar:focus-visible { box-shadow: var(--ring); }
.top-bar__profile-info { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border-subtle); }
.top-bar__profile-info strong { display: block; font-size: var(--text-sm); color: var(--text-strong); font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar__profile-info span { display: block; font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Generic dropdown (data-dropdown-toggle/-panel, layouts/app.blade.php) ----------
   Backs both the profile menu above and the export menu below — any future
   toggle+panel pair just needs the same data-dropdown-group value on both
   halves, no new CSS. */
.dropdown { position: relative; display: flex; flex: 0 0 auto; }
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
  z-index: 50; padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}
.dropdown-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; margin: 0;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-body); font: inherit; font-size: var(--text-sm); text-align: left;
  cursor: pointer; transition: var(--transition-control);
}
.dropdown-menu-item:hover { background: var(--surface-hover); color: var(--text-strong); }
.dropdown-menu-item--danger:hover { color: var(--red-600); }

/* ---------- Notification bell panel (livewire/shared/notification-bell) ---------- */
.notification-panel { width: 320px; padding: 0; }
.notification-panel__header { padding: 10px 14px; font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.notification-panel__list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.notification-panel__item { display: flex; align-items: center; gap: 9px; padding: 9px 14px; text-decoration: none; color: var(--text-body); font-size: var(--text-sm); }
.notification-panel__item:hover { background: var(--surface-hover); }
.notification-panel__item-text { flex: 1; }
.notification-panel__empty { padding: 10px 14px 14px; font-size: var(--text-sm); color: var(--text-muted); }
.notification-panel__footer { display: block; padding: 10px 14px; text-align: center; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-accent); text-decoration: none; border-top: 1px solid var(--border-subtle); }
.notification-panel__footer:hover { background: var(--surface-hover); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; background: var(--surface-app); }
.app-shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-shell__content { flex: 1; padding: 22px var(--gutter) 40px; }
.app-shell__content-inner { max-width: var(--page-max); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Metric tile grid (Dashboard) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-rail { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Auth (login) ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--surface-app); padding: 24px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; padding: 28px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.auth-card__brand { display: flex; align-items: center; gap: 10px; }
.auth-card__logo { width: 32px; height: 32px; border-radius: var(--radius-sm); object-fit: contain; }
.auth-card__brand-name { font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--text-strong); }
.auth-card__title { font-size: var(--text-h2); }
.auth-card__subtitle { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.auth-card__form { display: flex; flex-direction: column; gap: 14px; }
.auth-card__error { font-size: var(--text-xs); color: var(--red-600); background: var(--status-overdue-bg); border: 1px solid var(--red-100); border-radius: var(--radius-sm); padding: 8px 10px; }
.auth-card__footnote { margin: 0; text-align: center; font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- Navigation loading indicator (wire:navigate, layouts/app.blade.php) ---------- */
/* A slim, non-blocking presence — not a full-screen overlay — fixed near the
   top of the viewport, using the same floating-panel language as .toast /
   .dropdown-panel (surface-card + border-subtle + shadow-overlay).
   The logo pulses gently via CSS; the global prefers-reduced-motion rule in
   tokens/motion.css (animation-duration: .01ms !important on `*`) already
   neutralises this animation for users who request it. */
.nav-loading {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.nav-loading--visible { opacity: 1; transform: translate(-50%, 0); }
.nav-loading__logo {
  width: 20px; height: 20px; flex: 0 0 auto;
  border-radius: var(--radius-xs);
  object-fit: contain;
  animation: nav-loading-pulse 1.1s var(--ease-standard) infinite;
}
.nav-loading__label { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
@keyframes nav-loading-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.86); }
}

/* ---------- ServiceCard (components/data/ServiceCard.jsx) ---------- */
.service-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-standard);
}
.service-card:hover { box-shadow: var(--shadow-raised); }
.service-card__head { display: flex; align-items: center; gap: 11px; }
.service-card__title-wrap { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.service-card__name { font-size: var(--text-h3); color: var(--text-strong); letter-spacing: var(--text-h3-ls); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-card__client { font-size: var(--text-sm); color: var(--text-muted); }
.service-card__body { display: flex; flex-direction: column; gap: 6px; }
.service-card__desc { margin: 0; font-size: var(--text-sm); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.service-card__due { font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- Pagination (shared list footer — table/grid/timeline paging) ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6); flex-wrap: wrap;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}
.pagination--flush { padding: var(--space-5) var(--space-6); background: var(--table-head-bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.pagination__summary { font-size: var(--text-xs); color: var(--text-muted); }
.pagination__nav { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.pagination__btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--control-h-sm); min-width: var(--control-h-sm); padding: 0 var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-body);
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--weight-medium);
  cursor: pointer;
  transition: var(--transition-control);
}
.pagination__btn--page { padding: 0; }
.pagination__btn:hover:not(:disabled) { background: var(--surface-hover); }
.pagination__btn:disabled { cursor: not-allowed; opacity: .45; }
.pagination__btn--page[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-soft-border); color: var(--text-accent); }
.pagination__ellipsis { display: inline-flex; align-items: center; justify-content: center; height: var(--control-h-sm); min-width: 20px; color: var(--text-faint); font-size: var(--text-xs); }
.service-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }

/* Upload progress: a card at the bottom of the screen while a logo or
   payment proof uploads (percentage), then while the server checks it. Lives
   on <body>, so Livewire's re-renders never remove it mid-upload. */
.carregamento {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 95;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-overlay);
  transform: translate(-50%, 0);
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.carregamento--a-sair { opacity: 0; }
.carregamento__linha { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-sm); }
.carregamento__nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.carregamento__pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.carregamento__barra { margin-top: 8px; height: 6px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.carregamento__barra > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .15s linear; }
.carregamento--a-processar .carregamento__barra > span { width: 40% !important; animation: carregamento-vai-e-vem 1s var(--ease-standard) infinite alternate; }
.carregamento--feito .carregamento__barra > span { width: 100% !important; background: var(--money-in); }
.carregamento--erro .carregamento__barra > span { width: 100% !important; background: var(--red-600); }
.carregamento--erro .carregamento__pct { color: var(--red-600); }
@keyframes carregamento-vai-e-vem { from { margin-left: 0; } to { margin-left: 60%; } }

/* Balanced tile rows: 6 tiles as 3 + 3 (one row of 6 on wide screens),
   4 as 2 + 2 (one row of 4), so no row ends with a lonely tile and an empty
   gap. Phones keep one tile per line (the auto-fit rule above). */
@media (min-width: 640px) {
  .tile-grid:has(> :nth-child(6):last-child),
  .tile-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-grid:has(> :nth-child(4):last-child),
  .passos-iniciais:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1240px) {
  .tile-grid:has(> :nth-child(4):last-child),
  .passos-iniciais:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1560px) {
  .tile-grid:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Section titles in the sidebar ("Dia a dia", "Análise", "A tua empresa"…): the menu reads as groups, not one long list. */
.sidebar-nav__grupo { display: block; padding: 14px 10px 4px; font-size: 11px; font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.sidebar-nav__list > .sidebar-nav__grupo:first-child { padding-top: 4px; }
[data-sidebar-collapsed] .sidebar-nav__grupo { height: 1px; padding: 0; margin: 8px 10px; overflow: hidden; color: transparent; background: var(--border-subtle); }
