/* ============================================================
   MTZ FLOW · Componentes
   Botões, badges, cards, formulários, modais, toasts, tabelas,
   abas, dropdowns, gauges de score, kanban, timeline, etc.
   ============================================================ */

/* ---------------- BOTÕES ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: -.01em;
  padding: 11px 18px; border-radius: var(--r-pill); line-height: 1; white-space: nowrap;
  transition: transform .12s var(--ease), background var(--dur), box-shadow var(--dur), color var(--dur), border-color var(--dur);
  cursor: pointer; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn--primary { background: var(--mtz-blue); color: #fff; }
.btn--primary:hover { background: var(--blue-press); box-shadow: var(--sh-blue); }
.btn--green { background: var(--mtz-green); color: var(--mtz-indigo); }
.btn--green:hover { background: var(--green-press); }
.btn--mag { background: var(--mtz-magenta); color: #fff; }
.btn--mag:hover { background: var(--magenta-press); }
.btn--soft { background: var(--surface-strong); color: var(--ink); }
.btn--soft:hover { background: var(--hair-3); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hair); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--mtz-blue); color: var(--brand-ink); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--danger:hover { background: var(--mtz-magenta); color: #fff; }
.btn--ondark { background: var(--mtz-white); color: var(--mtz-indigo); }
.btn--ondark:hover { background: #fff; }
.btn--outline-dark { background: transparent; color: var(--on-dark); box-shadow: inset 0 0 0 1.5px var(--hair-dark); }
.btn--outline-dark:hover { box-shadow: inset 0 0 0 1.5px var(--on-dark); }
.btn--lg { font-size: 15.5px; padding: 15px 26px; }
.btn--sm { font-size: 12.5px; padding: 8px 14px; gap: 6px; }
.btn--xs { font-size: 11.5px; padding: 6px 11px; gap: 5px; }
.btn--icon { padding: 11px; }
.btn--icon.btn--sm { padding: 8px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .6s linear infinite;
  color: inherit;
}
.btn--primary.is-loading::after, .btn--mag.is-loading::after { border-color: #fff; border-top-color: transparent; }

/* ------------------------------------------------------------------
   BOTÃO SÓ-ÍCONE · padrão para AÇÕES EM LINHA DE LISTA.
   Numa lista o rótulo se repete em toda linha e vira ruído — vinte
   "Aprovar" empilhados não informam mais que um. O ícone resolve, e o
   nome da ação continua acessível pelo tooltip e pelo aria-label.
   Fora de lista (cabeçalho de página, modal, formulário) o botão
   CONTINUA com texto: lá o rótulo aparece uma vez e orienta.
   A cor de tom (--green, --soft, --ghost) é preservada.
   ------------------------------------------------------------------ */
.btn--icon { width: 36px; height: 36px; padding: 0; flex: none; gap: 0; }
.btn--icon .ico { width: 17px; height: 17px; }
.btn--icon.btn--sm { width: 34px; height: 34px; }
.btn--icon.btn--xs { width: 28px; height: 28px; }
.btn--icon.btn--xs .ico { width: 14px; height: 14px; }

/* Botão-ícone neutro (ações de linha) */
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--muted); transition: background var(--dur), color var(--dur);
}
.icon-btn:hover { background: var(--surface-strong); color: var(--ink); }
.icon-btn .ico { width: 18px; height: 18px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- BADGES / CHIPS / STATUS ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--surface-strong); color: var(--ink); white-space: nowrap;
}
.badge--blue { background: var(--mtz-blue); color: #fff; }
.badge--green { background: var(--mtz-green); color: var(--mtz-indigo); }
.badge--mag { background: var(--mtz-magenta); color: #fff; }
.badge--indigo { background: var(--mtz-indigo); color: var(--on-dark); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hair); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Status pill (operacional) · cor por semântica */
.status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650;
  padding: 4px 11px 4px 9px; border-radius: var(--r-pill); white-space: nowrap; letter-spacing: 0; text-transform: none;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status--ok       { background: var(--ok-bg);     color: var(--green-deep); }
.status--info     { background: var(--info-bg);   color: var(--info); }
.status--warn     { background: var(--warn-bg);   color: var(--warn); }
.status--danger   { background: var(--danger-bg); color: var(--danger); }
.status--neutral  { background: var(--surface-strong); color: var(--body); }
.status--indigo   { background: var(--surface-strong); color: var(--ink); }

/* Chips de filtro */
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: var(--r-pill); background: var(--surface); color: var(--body);
  border: 1.5px solid var(--hair); cursor: pointer; transition: all var(--dur); white-space: nowrap;
}
.chip:hover { border-color: var(--hair-3); color: var(--ink); }
.chip.active { background: var(--mtz-indigo); color: var(--on-dark); border-color: var(--mtz-indigo); }
.chip.active .chip-x { color: var(--on-dark-soft); }
.chip .chip-count { font-family: var(--mono); font-size: 11px; opacity: .7; }
.chiprow { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

/* Prioridade / risco ticks */
.pill-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pill-tick .sq { width: 9px; height: 9px; border-radius: 3px; }

/* ---------------- AVATARES ---------------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff; flex: none; letter-spacing: -.02em;
  background: var(--mtz-blue); position: relative; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--xs { width: 24px; height: 24px; font-size: 9.5px; }
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }
.avatar--xl { width: 84px; height: 84px; font-size: 28px; }
.avatar.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--mtz-green); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; box-shadow: 0 0 0 2.5px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-left: -10px;
  background: var(--surface-strong); color: var(--body); font-size: 11px; font-weight: 700; box-shadow: 0 0 0 2.5px var(--surface);
}

/* ---------------- CARDS ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-xl);
  padding: var(--s-6); box-shadow: var(--sh-sm);
}
.card--pad-lg { padding: var(--s-8); }
.card--flat { box-shadow: none; }
.card--indigo { background: var(--mtz-indigo); color: var(--on-dark); border-color: transparent; }
.card--blue { background: var(--mtz-blue); color: #fff; border-color: transparent; }
.card--interactive { cursor: pointer; transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur); }
.card--interactive:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--hair-3); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__title { font-size: 14.5px; font-weight: 750; color: var(--ink); letter-spacing: -.01em; }
.card--indigo .card__title, .card--blue .card__title { color: #fff; }
.card__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card__link { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 4px; }
.card__link:hover { gap: 7px; }

/* ---------------- STAT CARDS ---------------- */
.stat {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-xl);
  padding: 20px; position: relative; overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.stat--interactive { cursor: pointer; }
.stat--interactive:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat__ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; }
.stat__ico .ico { width: 20px; height: 20px; }
.stat__ico--blue { background: var(--blue-soft); color: var(--brand-ink); }
.stat__ico--green { background: var(--green-soft); color: var(--green-deep); }
.stat__ico--mag { background: var(--magenta-soft); color: var(--mtz-magenta); }
.stat__ico--warn { background: var(--warn-bg); color: var(--warn); }
.stat__ico--indigo { background: var(--surface-strong); color: var(--indigo-ink); }
.stat__n { font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.3rem); letter-spacing: -.03em; line-height: 1; color: var(--ink); font-feature-settings: 'tnum' 1; }
.stat__l { margin-top: 8px; font-size: 13px; color: var(--body); font-weight: 550; }
.stat__delta { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; font-weight: 700; margin-top: 10px; }
.stat__delta.up { color: var(--green-deep); }
.stat__delta.down { color: var(--mtz-magenta); }
.stat__delta.flat { color: var(--muted); }
.stat__spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 44px; opacity: .55; pointer-events: none; }

/* Stat card em LARGURA TOTAL (band horizontal): ícone · número+rótulo · delta · sparkline · seta */
.stat--wide { display: flex; align-items: center; gap: 22px; padding: 18px 26px; overflow: hidden; }
.stat--wide .stat__ico { flex: none; width: 44px; height: 44px; }
.stat--wide .stat__body { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-width: 0; }
.stat--wide .stat__nl { display: flex; align-items: baseline; gap: 14px; min-width: 0; flex-wrap: wrap; }
.stat--wide .stat__n { font-size: clamp(1.6rem, 2.2vw, 2rem); }
.stat--wide .stat__l { margin-top: 0; font-size: 14px; font-weight: 600; color: var(--body); white-space: nowrap; }
.stat--wide .stat__delta { margin-top: 0; flex: none; white-space: nowrap; }
.stat--wide .stat__spark { position: static; flex: none; width: 170px; height: 42px; opacity: .7; }
.stat--wide .stat__go { flex: none; }
@media (max-width: 640px) {
  .stat--wide { gap: 14px; padding: 16px 18px; }
  .stat--wide .stat__spark { display: none; }
  .stat--wide .stat__body { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------------- TABELAS ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--hair); background: var(--surface); }
table.tbl { width: 100%; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--hair); background: var(--surface-soft);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: var(--ink); }
.tbl thead th .sort-ico { opacity: .4; margin-left: 4px; display: inline-block; }
.tbl thead th.sorted .sort-ico { opacity: 1; color: var(--brand-ink); }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--hair-2); color: var(--body); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--dur); }
.tbl tbody tr:hover { background: var(--surface-soft); }
.tbl tbody tr.is-clickable { cursor: pointer; }
.tbl .cell-strong { font-weight: 700; color: var(--ink); }
.tbl .cell-mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .cell-actions { text-align: right; white-space: nowrap; }
.tbl td .u { display: flex; align-items: center; gap: 10px; }

/* ---------------- ABAS ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 16px; font-size: 13.5px; font-weight: 650; color: var(--muted); position: relative;
  white-space: nowrap; transition: color var(--dur); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--mtz-blue); }
.tab .tab-count { font-family: var(--mono); font-size: 10.5px; background: var(--surface-strong); color: var(--body); padding: 1px 6px; border-radius: var(--r-pill); margin-left: 6px; }
.tab.active .tab-count { background: var(--blue-soft); color: var(--brand-ink); }
.tab-panel { display: none; animation: fade .3s var(--ease); }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Segmented control (troca de visualização) */
.segmented { display: inline-flex; background: var(--surface-strong); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.segmented button, .segmented > a {
  padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 650; color: var(--body);
  display: inline-flex; align-items: center; gap: 6px; transition: all var(--dur);
}
.segmented button .ico, .segmented > a .ico { width: 15px; height: 15px; }
.segmented button.active, .segmented > a.active { background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh-xs); }

/* ---------------- FORMULÁRIOS ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 650; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.field .req { color: var(--mtz-magenta); font-weight: 800; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 46px; border-radius: var(--r-md); border: 1.5px solid var(--hair);
  background: var(--surface); padding: 0 14px; font-size: 14px; color: var(--ink);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--mtz-blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--mtz-magenta); box-shadow: 0 0 0 4px var(--magenta-soft); }
.field.is-ok .input, .field.is-ok .select, .field.is-ok .textarea { border-color: var(--green-deep); }
.field .err-msg { font-size: 11.5px; color: var(--mag-ink); font-weight: 600; display: none; align-items: center; gap: 5px; }
.field.has-error .err-msg { display: flex; }
.field .ok-msg { font-size: 11.5px; color: var(--green-deep); font-weight: 600; display: none; align-items: center; gap: 5px; }
.field.is-ok .ok-msg { display: flex; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A7A9A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 46px; }
.input-group .input.has-lead { padding-left: 42px; }
.input-group .lead-ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-group .trail-btn { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); }
.input-group .trail-btn:hover { color: var(--ink); background: var(--surface-strong); }

/* medidor de força de senha */
.pw-strength { display: flex; gap: 4px; margin-top: 2px; }
.pw-strength span { height: 4px; flex: 1; border-radius: 999px; background: var(--surface-strong); transition: background var(--dur); }
.pw-strength[data-level="1"] span:nth-child(1) { background: var(--mtz-magenta); }
.pw-strength[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.pw-strength[data-level="3"] span:nth-child(-n+3) { background: var(--green-press); }
.pw-strength[data-level="4"] span { background: var(--green-deep); }
.pw-strength-label { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* checkbox / switch / radio */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--body); user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--hair-3); display: grid; place-items: center; transition: all var(--dur); flex: none; background: var(--surface); }
.check .box .ico { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.5); transition: all var(--dur); }
.check input:checked + .box { background: var(--mtz-blue); border-color: var(--mtz-blue); }
.check input:checked + .box .ico { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--blue-soft); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-strong); position: relative; transition: background var(--dur); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: var(--mtz-green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--blue-soft); }

/* ---------------- MODAL ---------------- */
.modal-root { position: fixed; inset: 0; z-index: var(--z-modal); display: none; }
.modal-root.open { display: block; }
.modal-root .modal-overlay { position: absolute; inset: 0; background: rgba(24,3,64,.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--dur); }
.modal-root.open .modal-overlay { opacity: 1; }
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: hidden;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  opacity: 0; transition: opacity var(--dur), transform var(--dur) var(--ease); display: flex; flex-direction: column;
}
.modal-root.open .modal { opacity: 1; transform: translate(-50%, -50%); }
.modal--lg { width: min(760px, calc(100vw - 32px)); }
.modal--xl { width: min(1020px, calc(100vw - 32px)); }
.modal--sm { width: min(440px, calc(100vw - 32px)); }

/* Título de seção dentro de formulários longos */
.form-section {
  display: flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-ink); padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--hair-2);
}
.form-section .ico { width: 15px; height: 15px; }
.modal__head { padding: 22px 24px 0; display: flex; align-items: flex-start; gap: 14px; }
.modal__head .m-ico { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }
.modal__head h3 { font-size: 18px; font-weight: 780; letter-spacing: -.02em; color: var(--ink); }
.modal__head p { font-size: 13.5px; color: var(--body); margin-top: 4px; }
.modal__close { margin-left: auto; }
.modal__body { padding: 20px 24px; overflow-y: auto; }
.modal__foot { padding: 16px 24px; border-top: 1px solid var(--hair); display: flex; align-items: center; justify-content: flex-end; gap: 10px; background: var(--surface-soft); }
.modal__foot .spacer { flex: 1; }

/* Popup de confirmação · resumo da ação */
.confirm-summary { background: var(--surface-soft); border: 1px solid var(--hair); border-radius: var(--r-md); padding: 14px 16px; font-size: 13px; }
.confirm-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.confirm-summary dt { color: var(--muted); font-weight: 600; }
.confirm-summary dd { color: var(--ink); font-weight: 650; text-align: right; }
.confirm-consequence { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; color: var(--body); padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-bg); }
.confirm-consequence.is-danger { background: var(--danger-bg); }
.confirm-consequence.is-info { background: var(--info-bg); }
.confirm-consequence .ico { flex: none; margin-top: 1px; }

/* ---------------- DRAWER (detalhe lateral) ---------------- */
.drawer-root { position: fixed; inset: 0; z-index: var(--z-drawer); display: none; }
.drawer-root.open { display: block; }
.drawer-root .drawer-overlay { position: absolute; inset: 0; background: rgba(24,3,64,.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--dur); }
.drawer-root.open .drawer-overlay { opacity: 1; }
.drawer {
  position: absolute; right: 0; top: 0; height: 100%; width: min(760px, 100vw);
  background: var(--canvas); box-shadow: var(--sh-lg); transform: translateX(100%);
  transition: transform var(--dur) var(--ease); display: flex; flex-direction: column;
}
.drawer-root.open .drawer { transform: none; }
.drawer__head { flex: none; background: var(--surface); border-bottom: 1px solid var(--hair); padding: 18px 24px; display: flex; align-items: flex-start; gap: 14px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px; }

/* ---------------- TOAST ---------------- */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 12px; background: var(--mtz-indigo); color: var(--on-dark);
  padding: 13px 16px; border-radius: var(--r-md); box-shadow: var(--sh-lg); min-width: 280px; max-width: 400px;
  font-size: 13.5px; font-weight: 600; transform: translateX(120%); opacity: 0; transition: transform .3s var(--ease), opacity .3s;
  border: 1px solid var(--hair-dark);
}
.toast.show { transform: none; opacity: 1; }
.toast .t-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.toast--ok .t-ico { background: var(--mtz-green); color: var(--mtz-indigo); }
.toast--info .t-ico { background: var(--mtz-blue); color: #fff; }
.toast--warn .t-ico { background: var(--warn); color: #fff; }
.toast--danger .t-ico { background: var(--mtz-magenta); color: #fff; }
.toast .t-body { flex: 1; }
.toast .t-body b { color: #fff; display: block; }
.toast .t-body span { color: var(--on-dark-soft); font-weight: 500; font-size: 12px; }
.toast .t-close { color: var(--on-dark-mute); }
.toast .t-close:hover { color: #fff; }

/* ---------------- DROPDOWN / MENU ---------------- */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; z-index: 40;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--sh-md);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all var(--dur);
}
.dropdown.open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.dropdown__menu.left { right: auto; left: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 550; color: var(--body); width: 100%; text-align: left; transition: background var(--dur), color var(--dur); }
.menu-item:hover { background: var(--surface-soft); color: var(--ink); }
.menu-item .ico { width: 17px; height: 17px; color: var(--muted); }
.menu-item.danger { color: var(--mag-ink); }
.menu-item.danger .ico { color: var(--mag-ink); }
.menu-item.danger:hover { background: var(--danger-bg); }
.menu-sep { height: 1px; background: var(--hair); margin: 6px 4px; }
.menu-label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }

/* ---------------- PROGRESS / METER ---------------- */
.meter { height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--mtz-blue); transition: width .6s var(--ease); }
.meter.ok > span { background: var(--green-deep); }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--mtz-magenta); }
.meter--lg { height: 12px; }

/* ---------------- TOOLTIP ---------------- */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--mtz-indigo); color: var(--on-dark); padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; z-index: var(--z-tooltip); box-shadow: var(--sh-md); pointer-events: none;
}
[data-tooltip]:hover::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--mtz-indigo); z-index: var(--z-tooltip);
}

/* ---------------- SKELETON / LOADING / EMPTY ---------------- */
.skeleton { background: linear-gradient(90deg, var(--surface-strong) 25%, var(--surface-soft) 37%, var(--surface-strong) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 12px; margin: 8px 0; }
.sk-title { height: 20px; width: 40%; }
.sk-circle { border-radius: 50%; }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .es-ico { width: 76px; height: 76px; border-radius: var(--r-xl); background: var(--surface-soft); display: grid; place-items: center; margin: 0 auto 18px; color: var(--muted-2); position: relative; }
.empty-state .es-ico .mtz-seta { position: absolute; right: -7px; top: -7px; width: 26px; height: 26px; color: var(--brand-ink); }
.empty-state h3 { font-size: 19px; color: var(--ink); font-family: var(--serif); font-weight: var(--serif-w-sec); letter-spacing: -.01em; }
.empty-state p { font-size: 13.5px; color: var(--muted); max-width: 42ch; margin: 8px auto 20px; }

.loading-inline { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.loading-inline .spin-ico { width: 18px; height: 18px; border: 2px solid var(--hair-3); border-top-color: var(--mtz-blue); border-radius: 50%; animation: spin .6s linear infinite; }

/* ---------------- PAGINAÇÃO ---------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.pagination .pg-info { font-size: 12.5px; color: var(--muted); }
.pagination .pg-btns { display: flex; gap: 4px; }
.pg-btn { min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--body); border: 1.5px solid var(--hair); background: var(--surface); transition: all var(--dur); }
.pg-btn:hover { border-color: var(--mtz-blue); color: var(--brand-ink); }
.pg-btn.active { background: var(--mtz-blue); color: #fff; border-color: var(--mtz-blue); }
.pg-btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------------- ATIVOS DE MARCA · DS v2.0 ---------------- */
/* A SETA MTZ · sempre quadrada, sólida, herda currentColor.
   Nunca girar, achatar, contornar nem aplicar gradiente.        */
.mtz-seta { display: inline-block; vertical-align: middle; width: 1em; height: 1em; aspect-ratio: 1; flex: none; color: inherit; }
.mtz-selo { display: inline-block; vertical-align: middle; width: 1em; height: 1em; aspect-ratio: 1; flex: none; }
/* A ASSINATURA · arte fechada, uma cor sólida, mínimo 120px de largura */
.mtz-sig  { display: block; width: 100%; min-width: 120px; height: auto; color: inherit; }
.mtz-sig--sm { min-width: 0; }

/* Seta como máscara recolorível (bullets, pseudo-elementos, ícones) */
.seta-mask {
  -webkit-mask: var(--mtz-arrow) center/contain no-repeat;
  mask: var(--mtz-arrow) center/contain no-repeat;
  background: currentColor; aspect-ratio: 1; display: inline-block;
}

/* Lista com a Seta MTZ como marcador (padrão do DS para bullets) */
.list-seta { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.list-seta li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--body); line-height: 1.5; }
.list-seta li::before {
  content: ""; width: 11px; height: 11px; margin-top: 5px; flex: none;
  -webkit-mask: var(--mtz-arrow) center/contain no-repeat;
  mask: var(--mtz-arrow) center/contain no-repeat;
  background: var(--mtz-blue);
}
.on-dark .list-seta li { color: var(--on-dark-soft); }
.on-dark .list-seta li::before { background: var(--mtz-green); }
/* Sobre o indigo do tema escuro o azul da marca some: o marcador vira verde. */
[data-theme="dark"] .list-seta li::before { background: var(--mtz-green); }

/* Movimento correto da seta: flutuação, nunca rotação (regra do DS) */
.seta-float { animation: setaFloat 5.5s ease-in-out infinite; }
@keyframes setaFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.dotgrid { background-image: radial-gradient(var(--hair) 1.4px, transparent 1.4px); background-size: 18px 18px; }
/* Meio-tom da marca sobre superfícies escuras */
.dotgrid--dark { background-image: radial-gradient(rgba(255,255,255,.14) 1.4px, transparent 1.6px); background-size: 20px 20px; }

/* Divisor */
.divider { height: 1px; background: var(--hair); border: 0; margin: 0; }
.divider--dark { background: var(--hair-dark); }

/* Kbd inline */
kbd.k { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--body); border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); }

/* ============================================================
   SERVIÇOS CONTRATADOS (cadastro de cliente)
   ============================================================ */
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .svc-grid { grid-template-columns: 1fr; } }

.svc {
  border: 1.5px solid var(--hair); border-radius: var(--r-md); background: var(--surface);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur);
  overflow: hidden;
}
.svc.is-on { border-color: var(--mtz-blue); box-shadow: 0 0 0 3px rgba(19,19,225,.10); }

.svc__head { display: flex; align-items: center; gap: 11px; padding: 13px 14px; cursor: pointer; user-select: none; }
.svc__head input { position: absolute; opacity: 0; width: 0; height: 0; }
.svc__box {
  width: 19px; height: 19px; flex: none; border-radius: 6px; border: 1.5px solid var(--hair-3);
  display: grid; place-items: center; background: var(--surface); transition: all var(--dur);
}
.svc__box .ico { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity var(--dur); }
.svc__head input:checked + .svc__box { background: var(--mtz-blue); border-color: var(--mtz-blue); }
.svc__head input:checked + .svc__box .ico { opacity: 1; }
.svc__head input:focus-visible + .svc__box { outline: 2px solid var(--mtz-blue); outline-offset: 2px; }
.svc__ico { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-soft); color: var(--muted); transition: all var(--dur); }
.svc__ico .ico { width: 16px; height: 16px; }
.svc.is-on .svc__ico { background: var(--blue-soft); color: var(--brand-ink); }
.svc__name { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.25; min-width: 0; }
.svc__name i { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }

.svc__body { display: none; padding: 0 14px 14px 14px; flex-direction: column; gap: 12px; border-top: 1px solid var(--hair-2); margin-top: -1px; padding-top: 13px; }
.svc.is-on .svc__body { display: flex; }
.svc__field { display: flex; flex-direction: column; gap: 6px; }
.svc__label { font-size: 12px; font-weight: 650; color: var(--body); }
.svc__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.svc__num { display: flex; align-items: center; gap: 9px; }
.svc__num .input { height: 40px; max-width: 110px; }
.svc__suffix { font-size: 12px; color: var(--muted); font-weight: 600; }
.svc__body .select { height: 40px; }

/* Chip selecionável (multi-seleção) */
.chip-check { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-check span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 650; color: var(--body); background: var(--surface-soft);
  border: 1.5px solid transparent; transition: all var(--dur);
}
.chip-check:hover span { border-color: var(--hair-3); }
.chip-check input:checked + span { background: var(--blue-soft); border-color: var(--mtz-blue); color: var(--brand-ink); }
.chip-check input:focus-visible + span { outline: 2px solid var(--mtz-blue); outline-offset: 2px; }

/* Exibição do pacote contratado */
.svc-list { display: flex; flex-direction: column; gap: 2px; }
.svc-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair-2); }
.svc-item:last-child { border-bottom: 0; }
.svc-item__ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--brand-ink); }
.svc-item__ico .ico { width: 17px; height: 17px; }
.svc-item__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-item__txt b { font-size: 13.5px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.svc-item__txt span { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ============================================================
   PRIMEIROS PASSOS (sistema recém-instalado)
   ============================================================ */
.setup-state { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: clamp(24px, 4vw, 40px); box-shadow: var(--sh-sm); }
.setup-state__head { display: flex; gap: 20px; align-items: flex-start; }
.setup-state__mark { width: 52px; height: 52px; flex: none; border-radius: var(--r-lg); background: var(--blue-soft); display: grid; place-items: center; }
.setup-state__mark .mtz-seta { width: 24px; height: 24px; color: var(--brand-ink); }
.setup-state__head h3 { font-family: var(--serif); font-optical-sizing: auto; font-weight: var(--serif-w-sec); font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: var(--ink); line-height: 1.1; letter-spacing: -.015em; margin: 8px 0 0; }
.setup-state__head p { font-size: 14px; color: var(--body); margin-top: 10px; max-width: 66ch; line-height: 1.55; }
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.setup-step { display: flex; gap: 13px; padding: 18px; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--surface-soft); }
.setup-step.is-done { background: var(--ok-bg); border-color: rgba(83,121,12,.28); }
.setup-step__n { width: 27px; height: 27px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--mtz-blue); color: #fff; font-weight: 800; font-size: 12.5px; font-family: var(--mono); }
.setup-step.is-done .setup-step__n { background: var(--green-deep); }
.setup-step__n .ico { width: 14px; height: 14px; }
.setup-step__txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.setup-step__txt b { font-size: 14px; color: var(--ink); letter-spacing: -.01em; }
.setup-step__txt span { font-size: 12.5px; color: var(--body); line-height: 1.5; }
.setup-step__txt .btn { align-self: flex-start; }
.setup-state__foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--hair-2); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.setup-state__foot a { color: var(--brand-ink); font-weight: 650; }

/* ============================================================
   UPLOAD / DROPZONE (anexos)
   ============================================================ */
.dropzone__area {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  padding: 26px 20px; border: 1.5px dashed var(--hair-3); border-radius: var(--r-md);
  background: var(--surface-soft); cursor: pointer; transition: all var(--dur) var(--ease);
}
.dropzone__area:hover, .dropzone.is-over .dropzone__area { border-color: var(--mtz-blue); background: var(--blue-soft); }
.dropzone__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh-xs); }
.dropzone__ico .ico { width: 19px; height: 19px; }
.dropzone__txt { font-size: 13.5px; color: var(--body); }
.dropzone__txt b { color: var(--brand-ink); font-weight: 700; }
.dropzone__hint { font-size: 11.5px; color: var(--muted); max-width: 46ch; line-height: 1.45; }
.dropzone__list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.dropzone__list:empty { margin-top: 0; }
.dropzone__list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-soft); border: 1px solid var(--hair-2); font-size: 12.5px; color: var(--body);
}
.dropzone__list li .ft {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .05em;
  background: var(--blue-soft); color: var(--brand-ink); padding: 3px 7px; border-radius: 5px; flex: none;
}
.dropzone__list li .fn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; }
.dropzone__list li .fs { color: var(--muted); font-family: var(--mono); font-size: 11px; flex: none; }
.dropzone__list li.is-big { border-color: var(--mtz-magenta); background: var(--danger-bg); color: var(--mag-ink); }

/* Lista de anexos já salvos (detalhe da demanda) */
.filelist { display: flex; flex-direction: column; gap: 2px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair-2); }
.file-row:last-child { border-bottom: 0; }
.file-row__ico { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-soft); color: var(--muted); overflow: hidden; }
.file-row__ico .ico { width: 18px; height: 18px; }
.file-row__ico img { width: 100%; height: 100%; object-fit: cover; }
.file-row__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-row__txt b { font-size: 13px; color: var(--ink); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row__txt span { font-size: 11.5px; color: var(--muted); }
.file-row__actions { display: flex; gap: 2px; flex: none; }

/* Utilitários de espaçamento que faltavam */
.mb-1 { margin-bottom: 4px !important; }
.mt-1 { margin-top: 4px !important; }

/* Itens da Central de Aprovações */
.approval-item { transition: opacity var(--dur), transform var(--dur); }
.approval-item.is-going { opacity: 0; transform: translateX(12px); }
.apr-title { font-weight: 700; font-size: 14px; color: var(--ink); letter-spacing: -.01em; }
