/* Fontes da marca, reduzidas ao alfabeto latino. */
@font-face { font-family: "Ubuntu"; src: url(../fonts/Ubuntu-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url(../fonts/Ubuntu-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url(../fonts/Ubuntu-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Audiowide"; src: url(../fonts/Audiowide-Regular.woff2) format("woff2"); font-display: swap; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font: var(--weight-regular) var(--step-0) / var(--leading-normal) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: var(--leading-tight); font-weight: var(--weight-medium); text-wrap: balance; }
a { color: var(--brand-600); text-underline-offset: 2px; }
a:hover { color: var(--brand-800); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
small { font-size: var(--step--1); }
[ng-cloak] { display: none !important; }
.hide { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap;
}
.icon {
  width: var(--icon-size); height: var(--icon-size); flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-s { width: var(--icon-size-s); height: var(--icon-size-s); }
:focus-visible { outline: var(--outline-size) solid var(--focus-ring); outline-offset: var(--outline-size); }
.text-muted { color: var(--text-muted); }

/* ---------- Progresso das requisições ---------- */
#loaderAction, #loaderAction2 {
  position: fixed; inset: 0 0 auto 0; height: var(--focus-halo); z-index: var(--layer-progress);
  background: var(--brand-600); transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none;
}
#loaderAction.la-animate, #loaderAction2.la-animate {
  opacity: 1; animation: progresso 2.4s var(--ease-out) forwards;
}
@keyframes progresso { from { transform: scaleX(0.05); } to { transform: scaleX(0.92); } }

/* ---------- Estrutura ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.shell-main > [ui-view] { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.shell-main > [ui-view] > * { flex-shrink: 0; }
.container { width: 100%; padding-inline: var(--space-m); }

.topbar {
  position: sticky; top: 0; z-index: var(--layer-topbar);
  background: var(--brand-900); color: var(--text-on-brand);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); min-height: var(--topbar-height); }
.brand { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.wordmark { font-family: var(--font-brand); font-size: var(--step-2); letter-spacing: 0.01em; white-space: nowrap; }
.brand-tag {
  padding-left: var(--space-xs); border-left: var(--border-size) solid var(--on-brand-line);
  color: var(--text-on-brand-muted); font-size: var(--step--1); white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: var(--space-3xs); }
.topbar .icon-button { color: var(--text-on-brand); }
.topbar .icon-button:hover { background: var(--on-brand-hover); color: var(--text-on-brand); }
.topbar :focus-visible { outline-color: var(--text-on-brand); }

.icon-button {
  position: relative; display: inline-grid; place-items: center;
  width: var(--control-height); height: var(--control-height);
  border: 0; border-radius: var(--radius-2); background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color var(--duration-fast) linear, color var(--duration-fast) linear;
}
.icon-button:hover { background: var(--gray-100); color: var(--text); }
.count-badge {
  position: absolute; top: 2px; right: 2px; min-width: 1.05rem; padding: 0 0.25rem;
  border-radius: var(--radius-round); background: var(--danger-solid); color: var(--gray-0);
  font-size: var(--step--2); font-weight: var(--weight-bold); line-height: 1.05rem; text-align: center;
}

/* Menu da pessoa logada */
.menu { position: relative; }
.menu > summary {
  display: flex; align-items: center; gap: var(--space-2xs); min-height: var(--control-height);
  padding: 0 var(--space-2xs); border-radius: var(--radius-2); cursor: pointer; list-style: none; user-select: none;
  transition: background-color var(--duration-fast) linear;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--on-brand-hover); }
.menu[open] > summary .icon { transform: rotate(180deg); }
.menu > summary .icon { transition: transform var(--duration-medium) var(--ease-out); }
.menu-avatar {
  display: grid; place-items: center; width: var(--avatar-size); height: var(--avatar-size);
  border-radius: var(--radius-round); background: var(--brand-700); color: var(--text-on-brand);
  font-size: var(--step--1); font-weight: var(--weight-medium);
}
.menu-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel {
  position: absolute; top: calc(100% + var(--space-3xs)); right: 0; z-index: var(--layer-menu);
  width: 16rem; padding: var(--space-2xs); border: var(--border-size) solid var(--border);
  border-radius: var(--radius-2); background: var(--surface); box-shadow: var(--shadow-2); color: var(--text);
  transform-origin: top right; animation: surgir var(--duration-medium) var(--ease-out);
}
.menu-bell > summary { position: relative; justify-content: center; width: var(--control-height); padding: 0; }
.bell-panel { width: min(calc(100vw - 2 * var(--space-s)), var(--bell-width)); padding: 0; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); padding: var(--space-xs) var(--space-s); border-bottom: var(--border-size) solid var(--border); }
.bell-head strong { font-weight: var(--weight-medium); }
.bell-empty { padding: var(--space-m) var(--space-s); color: var(--text-muted); text-align: center; }
.bell-list { max-height: min(60dvh, 26rem); margin: 0; padding: var(--space-3xs); overflow-y: auto; list-style: none; }
.bell-item { display: grid; gap: 2px; width: 100%; padding: var(--space-2xs) var(--space-xs); border: 0; border-radius: var(--radius-1); background: none; text-align: left; cursor: pointer; }
.bell-item:hover { background: var(--surface-hover); }
.bell-item-top strong { color: var(--brand-600); font-weight: var(--weight-medium); }
.bell-item-text { display: -webkit-box; overflow: hidden; color: var(--text-soft); -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.menu-info { padding: var(--space-2xs) var(--space-xs) var(--space-xs); border-bottom: var(--border-size) solid var(--border); margin-bottom: var(--space-3xs); }
.menu-info strong { display: block; font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.menu-item {
  display: flex; align-items: center; gap: var(--space-2xs); width: 100%; padding: var(--space-2xs) var(--space-xs);
  border: 0; border-radius: var(--radius-1); background: none; color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--surface-hover); color: var(--text); }
@keyframes surgir { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2xs) var(--space-m);
  padding-block: var(--space-m); color: var(--text-muted); font-size: var(--step--1);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: var(--control-height); padding: 0 var(--space-s);
  border: var(--border-size) solid transparent; border-radius: var(--radius-2);
  background: transparent; font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--duration-fast) linear, border-color var(--duration-fast) linear,
    color var(--duration-fast) linear, transform var(--duration-fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--text-on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: var(--text-on-brand); }
.btn-default { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-default:hover:not(:disabled) { background: var(--gray-100); color: var(--text); }
.btn-danger { background: var(--danger-solid); color: var(--gray-0); }
.btn-danger:hover:not(:disabled) { background: var(--danger-solid-hover); color: var(--gray-0); }
.btn-danger-outline { border-color: var(--border-strong); background: var(--surface); color: var(--danger-text); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger-text); color: var(--danger-text); }
.btn-whatsapp { background: var(--whatsapp-solid); color: var(--gray-0); }
.btn-whatsapp:hover { background: var(--whatsapp-solid-hover); color: var(--gray-0); }
.btn-sm { min-height: var(--control-height-s); padding: 0 var(--space-xs); font-size: var(--step--1); }
.btn-block { width: 100%; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-button:hover { color: var(--brand-800); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-3xs); }
.field-label { font-weight: var(--weight-medium); color: var(--text-soft); }
.field-mark { color: var(--danger-text); font-style: normal; font-weight: var(--weight-bold); }
.field-help { color: var(--text-muted); }
.form-stack { display: grid; gap: var(--space-s); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--space-s); }
.form-control {
  display: block; width: 100%; min-height: var(--control-height); padding: var(--space-2xs) var(--space-xs);
  border: var(--border-size) solid var(--border-strong); border-radius: var(--radius-2); background: var(--surface); color: var(--text);
  transition: border-color var(--duration-fast) linear, box-shadow var(--duration-fast) linear;
}
.form-control::placeholder { color: var(--gray-500); }
.form-control:hover:not(:disabled) { border-color: var(--gray-500); }
.form-control:focus { outline: 0; border-color: var(--focus-ring); box-shadow: 0 0 0 var(--focus-halo) var(--brand-100); }
.form-control:disabled { background: var(--gray-100); color: var(--text-muted); }
textarea.form-control { min-height: var(--textarea-height); resize: vertical; field-sizing: content; }
select.form-control {
  appearance: none; padding-right: var(--space-l);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23526170' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-xs) center;
}
.form-control.hasRequired { border-color: var(--danger-text); box-shadow: 0 0 0 var(--focus-halo) var(--danger-bg); }
.hasRequiredLabel { color: var(--danger-text); }
.input-action { position: relative; }
.input-action .form-control { padding-right: calc(var(--control-height) + var(--space-3xs)); }
.input-action .icon-button { position: absolute; top: 0; right: 0; }
.check-row { display: flex; align-items: center; gap: var(--space-2xs); min-height: var(--control-height-s); cursor: pointer; }
.check-row input { width: var(--icon-size); height: var(--icon-size); margin: 0; accent-color: var(--primary); flex: none; }
.file-box { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs); border: var(--border-size) solid var(--border); border-radius: var(--radius-2); background: var(--surface-sunken); }
.file-box-thumb { display: grid; place-items: center; width: var(--thumb-size); height: var(--thumb-size); flex: none; overflow: hidden; border-radius: var(--radius-1); background: var(--gray-100); color: var(--text-muted); }
.file-box-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-box-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.file-box-actions { display: flex; gap: var(--space-3xs); flex: none; }
.attach-trigger {
  display: flex; align-items: center; gap: var(--space-2xs); width: 100%; padding: var(--space-xs) var(--space-s);
  border: var(--border-size) dashed var(--border-strong); border-radius: var(--radius-2); background: var(--surface);
  color: var(--text-soft); font-weight: var(--weight-medium); cursor: pointer;
  transition: background-color var(--duration-fast) linear, border-color var(--duration-fast) linear;
}
.attach-trigger:hover { background: var(--surface-hover); border-color: var(--brand-600); }
.password-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3xs) var(--space-s); margin: 0; padding: var(--space-xs); border-radius: var(--radius-2); background: var(--surface-sunken); list-style: none; font-size: var(--step--1); color: var(--text-muted); }
.password-rules li { display: flex; align-items: center; gap: var(--space-3xs); }
.password-rules .is-ok { color: var(--success-text); font-weight: var(--weight-medium); }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface); }
.auth-brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-l);
  padding: var(--space-xl) var(--space-l); overflow: hidden;
  background-color: var(--brand-900);
  background-image: radial-gradient(var(--on-brand-dot) 1px, transparent 1px);
  background-size: var(--dot-grid) var(--dot-grid); color: var(--text-on-brand);
}
.auth-brand .wordmark { font-size: var(--step-4); display: block; }
.auth-brand-tag { color: var(--text-on-brand-muted); font-size: var(--step-1); }
.auth-brand-lead { max-width: 24rem; font-size: var(--step-3); font-weight: var(--weight-regular); line-height: var(--leading-tight); }
.auth-brand-foot { color: var(--text-on-brand-muted); font-size: var(--step--1); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: var(--space-xl) var(--space-m); }
.auth-form { width: min(100%, var(--form-width)); }
.auth-form h1 { font-size: var(--step-3); }
.auth-form > p { margin-top: var(--space-3xs); margin-bottom: var(--space-m); color: var(--text-muted); }
.auth-links { display: flex; justify-content: space-between; gap: var(--space-s); margin-top: var(--space-m); padding-top: var(--space-s); border-top: var(--border-size) solid var(--border); }

/* ---------- Lista de chamados ---------- */
.page { padding-block: var(--space-m) 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-s); margin-bottom: var(--space-m); }
.page-head h1 { font-size: var(--step-3); }
.page-head p { margin-top: var(--space-3xs); color: var(--text-muted); }
.card { border: var(--border-size) solid var(--border); border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-1); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-s); border-bottom: var(--border-size) solid var(--border); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-2); background: var(--gray-100); }
.segmented button {
  min-height: var(--control-height-s); padding: 0 var(--space-xs); border: 0; border-radius: calc(var(--radius-2) - 2px);
  background: transparent; color: var(--text-muted); font-weight: var(--weight-medium); cursor: pointer;
  transition: background-color var(--duration-fast) linear, color var(--duration-fast) linear;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.search { position: relative; flex: 1 1 14rem; min-width: 0; }
.search .icon { position: absolute; top: 50%; left: var(--space-xs); transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search .form-control { padding-left: calc(var(--space-xs) * 2 + var(--icon-size)); }
.sort { display: flex; align-items: center; gap: var(--space-2xs); color: var(--text-muted); white-space: nowrap; }
.sort .form-control { width: auto; }
.sort-mobile { display: none; }
.count-pill { min-width: 1.25rem; padding: 0 var(--space-3xs); border-radius: var(--radius-round); background: var(--primary); color: var(--text-on-brand); font-size: var(--step--2); line-height: 1.25rem; text-align: center; }
.filter-panel { padding: var(--space-s); border-bottom: var(--border-size) solid var(--border); background: var(--surface-sunken); animation: surgir var(--duration-medium) var(--ease-out); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--space-xs) var(--space-s); }
.filter-actions { display: flex; justify-content: flex-end; gap: var(--space-2xs); margin-top: var(--space-s); }
.period { display: flex; align-items: center; gap: var(--space-2xs); }
.period .form-control { min-width: 0; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs) var(--space-s); border-bottom: var(--border-size) solid var(--border); font-size: var(--step--1); }
.filter-chip {
  display: inline-flex; align-items: center; gap: var(--space-3xs); padding: var(--space-3xs) var(--space-2xs);
  border: var(--border-size) solid var(--border-strong); border-radius: var(--radius-round); background: var(--surface); color: var(--text-soft); cursor: pointer;
  transition: background-color var(--duration-fast) linear, border-color var(--duration-fast) linear;
}
.filter-chip strong { font-weight: var(--weight-medium); color: var(--text); }
.filter-chip:hover { background: var(--danger-bg); border-color: var(--danger-text); }
.update-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs) var(--space-s); background: var(--brand-100); color: var(--brand-700); animation: surgir var(--duration-medium) var(--ease-out); }
.update-banner .link-button { color: var(--brand-800); font-weight: var(--weight-medium); }
.scroll-sentinel { height: 1px; }
.alert-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs) var(--space-s); background: var(--warning-bg); color: var(--warning-text); }

.table-wrap { position: relative; overflow-x: auto; }
.tickets { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tickets th {
  position: sticky; top: 0; z-index: 1; padding: 0; background: var(--surface-sunken); color: var(--text-muted);
  font-size: var(--step--1); font-weight: var(--weight-medium); text-align: left; white-space: nowrap;
  box-shadow: inset 0 calc(-1 * var(--border-size)) 0 var(--border);
}
.th-sort {
  display: inline-flex; align-items: center; gap: var(--space-3xs); width: 100%; padding: var(--space-2xs) var(--space-s);
  border: 0; background: none; color: inherit; font: inherit; text-align: left; white-space: nowrap; cursor: pointer;
  transition: color var(--duration-fast) linear;
}
.th-sort .icon { opacity: 0.4; transition: opacity var(--duration-fast) linear; }
.th-sort:hover { color: var(--text); }
.th-sort:hover .icon { opacity: 0.8; }
.th-sort.is-active { color: var(--brand-700); font-weight: var(--weight-bold); }
.th-sort.is-active .icon { opacity: 1; }
.tickets th:not(:has(.th-sort)) { padding: var(--space-2xs) var(--space-s); }
.tickets td { padding: var(--space-xs) var(--space-s); border-bottom: var(--border-size) solid var(--gray-100); vertical-align: middle; }
.tickets tbody tr { cursor: pointer; transition: background-color var(--duration-fast) linear; }
.tickets tbody tr:hover { background: var(--surface-hover); }
.tickets tbody tr.is-new { animation: destaque 2.4s linear; }
@keyframes destaque { 0%, 40% { background: var(--brand-100); } }
.tickets tbody tr:hover .row-go { color: var(--brand-600); transform: translateX(2px); }
.ticket-id {
  padding: var(--space-3xs) 0; border: 0; background: none; color: var(--brand-600); font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.cell-main { font-weight: var(--weight-medium); min-width: 14rem; }
.cell-nowrap { white-space: nowrap; }
.cell-event { display: inline-flex; flex-direction: column; }
.cell-person { display: inline-flex; align-items: center; gap: var(--space-3xs); white-space: nowrap; }
.cell-person .icon { color: var(--text-muted); }
.cell-wait { display: inline-flex; align-items: center; gap: var(--space-3xs); color: var(--text-muted); white-space: nowrap; }
.row-go { display: block; margin-left: auto; color: var(--gray-300); transition: color var(--duration-fast) linear, transform var(--duration-fast) var(--ease-out); }

.chip {
  display: inline-block; padding: 0.125rem var(--space-2xs); border-radius: var(--radius-round);
  background: var(--gray-100); color: var(--text-soft); font-size: var(--step--1); font-weight: var(--weight-medium); white-space: nowrap;
}
.tone-info { background: var(--info-bg); color: var(--info-text); }
.tone-brand { background: var(--brand-100); color: var(--brand-700); }
.tone-warning { background: var(--warning-bg); color: var(--warning-text); }
.tone-success { background: var(--success-bg); color: var(--success-text); }
.tone-danger { background: var(--danger-bg); color: var(--danger-text); }

.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs); padding: var(--space-xs) var(--space-s); color: var(--text-muted); font-size: var(--step--1); }

.state { display: flex; flex-direction: column; align-items: center; gap: var(--space-2xs); padding: var(--space-xl) var(--space-m); text-align: center; }
.state > .icon { width: var(--avatar-size); height: var(--avatar-size); color: var(--gray-500); stroke-width: 1.5; }
.state h2 { font-size: var(--step-1); }
.state p { max-width: 28rem; color: var(--text-muted); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2xs); margin-top: var(--space-2xs); }

.skeleton-row { display: flex; gap: var(--space-m); padding: var(--space-s); border-bottom: var(--border-size) solid var(--gray-100); }
.skeleton { height: 0.875rem; border-radius: var(--radius-1); background: var(--gray-100); animation: pulso 1.4s ease-in-out infinite; }
.skeleton:nth-child(1) { width: 8%; }
.skeleton:nth-child(2) { width: 34%; }
.skeleton:nth-child(3) { width: 18%; }
.skeleton:nth-child(4) { width: 14%; }
@keyframes pulso { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Modais ---------- */
.modal {
  position: fixed; inset: 0; z-index: var(--layer-modal); display: none;
  align-items: flex-start; justify-content: center; padding: var(--space-m);
  background: var(--scrim); overflow-y: auto; overscroll-behavior: contain;
}
.modal.is-open { display: flex; animation: aparecer var(--duration-medium) linear; }
.modal-dialog {
  display: flex; flex-direction: column; width: min(100%, var(--modal-width)); max-height: calc(100dvh - 2 * var(--space-m));
  border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-3); outline: 0;
  animation: entrar var(--duration-spring) var(--ease-spring);
}
.modal-lg { width: min(100%, var(--modal-width-lg)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); padding: var(--space-s) var(--space-m); border-bottom: var(--border-size) solid var(--border); }
.modal-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); font-size: var(--step-2); }
.modal-body { flex: 1; min-height: 0; padding: var(--space-m); overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); padding: var(--space-s) var(--space-m); border-top: var(--border-size) solid var(--border); }
.modal-foot-spacer { flex: 1; }
body.modal-open { overflow: hidden; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes entrar { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Detalhe do chamado ---------- */
.detail-title { font-size: var(--step-2); }
.detail-desc { margin-top: var(--space-2xs); color: var(--text-soft); white-space: pre-line; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--space-s); margin: var(--space-m) 0 0; padding: var(--space-s); border-radius: var(--radius-2); background: var(--surface-sunken); }
.facts dt { color: var(--text-muted); font-size: var(--step--1); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.section-title { margin: var(--space-m) 0 var(--space-2xs); font-size: var(--step-0); font-weight: var(--weight-medium); color: var(--text-soft); }
.attachments { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: 0; padding: 0; list-style: none; }
.attachment {
  display: inline-flex; align-items: center; gap: var(--space-3xs); max-width: 100%; padding: var(--space-3xs) var(--space-2xs);
  border: var(--border-size) solid var(--border); border-radius: var(--radius-1); background: var(--surface);
  font-size: var(--step--1); text-decoration: none; overflow-wrap: anywhere;
  transition: background-color var(--duration-fast) linear;
}
.attachment:hover { background: var(--surface-hover); }
.composer { display: grid; gap: var(--space-2xs); margin-top: var(--space-m); }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs); }
.timeline { display: grid; gap: var(--space-s); margin: var(--space-m) 0 0; padding: 0; list-style: none; }
.message { display: flex; gap: var(--space-2xs); max-width: min(100%, 38rem); }
.message-avatar { width: var(--avatar-size); height: var(--avatar-size); flex: none; border-radius: var(--radius-round); background: var(--gray-100); object-fit: cover; }
.message-bubble { min-width: 0; padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-1) var(--radius-3) var(--radius-3) var(--radius-3); background: var(--surface-sunken); overflow-wrap: anywhere; }
.message-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2xs); margin-bottom: var(--space-3xs); }
.message-head strong { font-weight: var(--weight-medium); }
.message-head small { color: var(--text-muted); }
.message-attachments { margin-top: var(--space-2xs); }
.message.is-support { flex-direction: row-reverse; margin-left: auto; }
.message.is-support .message-bubble { border-radius: var(--radius-3) var(--radius-1) var(--radius-3) var(--radius-3); background: var(--brand-100); }

/* ---------- Comunicados ---------- */
.panel-float {
  position: fixed; right: var(--space-m); bottom: var(--space-m); z-index: var(--layer-panel);
  display: flex; flex-direction: column; width: min(calc(100vw - 2 * var(--space-m)), var(--toast-width)); max-height: min(70dvh, 32rem);
  border: var(--border-size) solid var(--border); border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-3);
  animation: entrar var(--duration-spring) var(--ease-spring);
}
.panel-float-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-3xs) var(--space-3xs) var(--space-s); border-bottom: var(--border-size) solid var(--border); color: var(--text-muted); font-size: var(--step--1); font-weight: var(--weight-medium); }
.panel-float-body { flex: 1; min-height: 0; padding: var(--space-s); overflow-y: auto; }
.panel-float-body h3 { margin-bottom: var(--space-3xs); font-size: var(--step-1); }
.panel-float-actions { display: flex; justify-content: flex-end; gap: var(--space-2xs); padding: 0 var(--space-s) var(--space-s); }
.notice-list { display: grid; gap: var(--space-3xs); margin: 0; padding: var(--space-2xs); list-style: none; }
.notice-item { display: block; width: 100%; padding: var(--space-2xs) var(--space-xs); border: 0; border-radius: var(--radius-1); background: none; text-align: left; cursor: pointer; }
.notice-item:hover { background: var(--surface-hover); }
.notice-item strong { display: block; font-weight: var(--weight-medium); }
.notice-item small { color: var(--text-muted); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; top: var(--space-s); right: var(--space-s); z-index: var(--layer-toast);
  display: grid; gap: var(--space-2xs); width: min(calc(100vw - 2 * var(--space-s)), var(--toast-width)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--space-2xs); padding: var(--space-xs) var(--space-s);
  border: var(--border-size) solid var(--border); border-left-width: var(--space-3xs); border-radius: var(--radius-2);
  background: var(--surface); box-shadow: var(--shadow-3); pointer-events: auto; cursor: pointer;
  animation: toast-entra var(--duration-spring) var(--ease-spring);
}
.toast.is-leaving { opacity: 0; transform: translateX(8px); transition: opacity var(--duration-medium) linear, transform var(--duration-medium) var(--ease-out); }
.toast strong { display: block; font-weight: var(--weight-medium); }
.toast-success { border-left-color: var(--success-text); }
.toast-success .icon { color: var(--success-text); }
.toast-danger { border-left-color: var(--danger-text); }
.toast-danger .icon { color: var(--danger-text); }
.toast-warning { border-left-color: var(--warning-text); }
.toast-warning .icon { color: var(--warning-text); }
@keyframes toast-entra { from { opacity: 0; transform: translateX(12px); } }

/* ---------- Aviso de novo endereço ---------- */
.portal-notice-overlay {
  position: fixed; inset: 0; z-index: var(--layer-notice); display: flex; align-items: center; justify-content: center;
  padding: var(--space-m); background: var(--scrim); animation: aparecer var(--duration-medium) linear;
}
.portal-notice-card {
  position: relative; width: min(100%, var(--modal-width)); padding: var(--space-l) var(--space-m) var(--space-m);
  border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-3); animation: entrar var(--duration-spring) var(--ease-spring);
}
.portal-notice-close { position: absolute; top: var(--space-2xs); right: var(--space-2xs); }
.portal-notice-mark { display: grid; place-items: center; width: var(--thumb-size); height: var(--thumb-size); margin-bottom: var(--space-s); border-radius: var(--radius-round); background: var(--warning-bg); color: var(--warning-text); }
.portal-notice-card h2 { margin-bottom: var(--space-2xs); font-size: var(--step-3); }
.portal-notice-card p { margin-bottom: var(--space-2xs); color: var(--text-soft); }
.portal-notice-actions { display: grid; gap: var(--space-2xs); margin-top: var(--space-m); }

/* ---------- Diálogos do angular-confirm ---------- */
.ng-confirm .ng-confirm-bg { background: var(--brand-900) !important; opacity: 0.5 !important; }
.ng-confirm .ng-confirm-box-p { width: min(100%, var(--dialog-width)); margin-inline: auto; }
.ng-confirm .ng-confirm-box {
  padding: var(--space-m) !important; border-radius: var(--radius-3) !important; background: var(--surface) !important;
  box-shadow: var(--shadow-3) !important; font-family: var(--font-sans);
}
.ng-confirm .ng-confirm-title-c { padding-bottom: var(--space-2xs) !important; }
.ng-confirm .ng-confirm-title { color: var(--text); font-size: var(--step-2) !important; font-weight: var(--weight-medium) !important; }
.ng-confirm .ng-confirm-content { color: var(--text-soft); margin-bottom: var(--space-s) !important; }
.ng-confirm .ng-confirm-content .form-control { margin-top: var(--space-2xs); }
.ng-confirm .ng-confirm-buttons { display: flex; flex-direction: row-reverse; gap: var(--space-2xs); float: none !important; padding: 0 !important; }
.ng-confirm .ng-confirm-buttons button { min-height: var(--control-height) !important; margin: 0 !important; padding: 0 var(--space-s) !important; border-radius: var(--radius-2) !important; font-size: var(--step-0) !important; font-weight: var(--weight-medium) !important; text-transform: none !important; }
.ng-confirm .ng-confirm-buttons .btn-primary { background: var(--primary) !important; color: var(--text-on-brand) !important; }
.ng-confirm .ng-confirm-buttons .btn-default { background: var(--surface) !important; border: var(--border-size) solid var(--border-strong) !important; color: var(--text) !important; }
.ng-confirm .ng-confirm-closeIcon { color: var(--text-muted) !important; }

/* ---------- Navegação do topo ---------- */
.topnav { display: flex; gap: var(--space-3xs); margin-right: auto; margin-left: var(--space-s); }
.topnav a { padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-2); color: var(--text-on-brand-muted); font-weight: var(--weight-medium); text-decoration: none; transition: background-color var(--duration-fast) linear, color var(--duration-fast) linear; }
.topnav a:hover { background: var(--on-brand-hover); color: var(--text-on-brand); }
.topnav a.is-active { background: var(--on-brand-hover); color: var(--text-on-brand); }

/* ---------- Indicadores ---------- */
.dash-page { padding-block: var(--space-m); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tile-min)), 1fr)); gap: var(--space-s); margin-bottom: var(--space-s); }
.stat { position: relative; display: flex; flex-direction: column; gap: var(--space-3xs); padding: var(--space-s); transition: border-color var(--duration-fast) linear, box-shadow var(--duration-fast) linear; }
.stat.is-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.stat-link { position: absolute; inset: 0; border: 0; border-radius: var(--radius-3); background: none; cursor: pointer; }
.stat-label { color: var(--text-muted); font-size: var(--step--1); }
.stat-value { font-size: var(--step-3); font-weight: var(--weight-medium); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.stat-detail { display: inline-flex; align-items: center; gap: var(--space-3xs); color: var(--text-muted); }
.stat-detail.is-good { color: var(--success-text); }
.stat-detail.is-bad { color: var(--danger-text); }
.stat-skeleton { width: 60% !important; height: var(--space-m); }
.chart-card { padding: var(--space-s); margin-bottom: var(--space-s); min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2xs) var(--space-m); margin-bottom: var(--space-s); }
.chart-head h2 { font-size: var(--step-1); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-s); margin: 0; padding: 0; list-style: none; color: var(--text-soft); font-size: var(--step--1); }
.chart-legend li { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.legend-line { display: inline-block; width: var(--space-s); height: var(--outline-size); border-radius: var(--radius-round); }
.legend-1 { background: var(--series-1); }
.legend-2 { background: var(--series-2); }
.chart-empty { padding: var(--space-xl) var(--space-s); color: var(--text-muted); text-align: center; }
.chart-plot { position: relative; height: var(--chart-height); }
.chart-plot svg { display: block; width: 100%; height: 100%; }
.chart-plot svg:focus-visible { outline-offset: 0; }
.chart-plot .eixo { fill: var(--text-muted); font-size: 0.75rem; }
.chart-plot .rotulo-fim { fill: var(--text); font-size: 0.8125rem; font-weight: var(--weight-medium); }
.chart-plot .grade { stroke: var(--chart-grid); stroke-width: 1; }
.chart-plot .mira { stroke: var(--border-strong); stroke-width: 1; }
.chart-plot .linha { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-plot .serie-1 { stroke: var(--series-1); }
.chart-plot .serie-2 { stroke: var(--series-2); }
.chart-plot .ponto { stroke: var(--surface); stroke-width: 2; }
.chart-plot .ponto-1 { fill: var(--series-1); }
.chart-plot .ponto-2 { fill: var(--series-2); }
.chart-tip { position: absolute; top: 0; z-index: 2; min-width: 10rem; padding: var(--space-2xs) var(--space-xs); border: var(--border-size) solid var(--border); border-radius: var(--radius-2); background: var(--surface); box-shadow: var(--shadow-2); font-size: var(--step--1); pointer-events: none; }
.chart-tip-title { margin-bottom: var(--space-3xs); color: var(--text-muted); }
.chart-tip-row { display: flex; align-items: center; gap: var(--space-2xs); }
.chart-tip-row strong { min-width: 2ch; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.chart-tip-row span:last-child { color: var(--text-soft); }
.chart-table { margin-top: var(--space-xs); font-size: var(--step--1); }
.chart-table summary { color: var(--brand-600); cursor: pointer; }
.chart-table table { width: 100%; margin-top: var(--space-2xs); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: var(--space-3xs) var(--space-2xs); border-bottom: var(--border-size) solid var(--gray-100); text-align: left; }
.chart-table th { color: var(--text-muted); font-weight: var(--weight-medium); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--chart-min)), 1fr)); gap: 0 var(--space-s); }
.bars { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bar { display: grid; grid-template-columns: minmax(0, var(--bar-name-width)) minmax(0, 1fr) auto; align-items: center; gap: var(--space-2xs); width: 100%; min-height: var(--control-height-s); padding: var(--space-3xs) var(--space-2xs); border: 0; border-radius: var(--radius-1); background: none; text-align: left; cursor: pointer; transition: background-color var(--duration-fast) linear; }
.bar:hover:not(:disabled) { background: var(--surface-hover); }
.bar:disabled { cursor: default; }
.bar-name { overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; min-width: 0; }
.bar-fill { display: block; min-width: var(--outline-size); height: var(--bar-thickness); border-radius: 0 var(--radius-1) var(--radius-1) 0; background: var(--series-1); transition: width var(--duration-medium) var(--ease-out); }
.bar-value { min-width: 3ch; font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Tela cheia: a lista rola por dentro, com cabeçalho fixo ---------- */
@media (min-width: 861px) {
  .shell { height: 100dvh; overflow: hidden; }
  .shell-main { overflow: hidden; }
  .page { flex: 1; min-height: 0; display: flex; flex-direction: column; flex-shrink: 1 !important; }
  .page-head { margin-bottom: var(--space-s); flex: none; }
  .list-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .list-card > .table-wrap { flex: 1; min-height: 0; overflow: auto; }
  .list-foot { flex: none; border-top: var(--border-size) solid var(--border); }
  .tickets td { padding-inline: var(--space-xs); white-space: nowrap; }
  .th-sort { padding-inline: var(--space-xs); }
  .cell-text { display: block; max-width: var(--cell-width); overflow: hidden; text-overflow: ellipsis; }
  .tickets td.cell-main { width: 100%; min-width: var(--cell-main-width); white-space: normal; }
  .tickets td.cell-main > .cell-text { max-width: none; }
  .site-footer { flex: none; padding-block: var(--space-2xs); }
  .filter-panel { max-height: 45dvh; overflow-y: auto; flex: none; }
  .auth { flex: 1; overflow: auto; flex-shrink: 1 !important; }
  .dash-page { flex: 1; min-height: 0; overflow-y: auto; flex-shrink: 1 !important; }
}

/* ---------- Telas menores ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { padding: var(--space-m); }
  .auth-brand .wordmark { font-size: var(--step-3); }
  .auth-brand-lead, .auth-brand-foot { display: none; }
  .auth-panel { align-items: flex-start; padding-block: var(--space-l); }

  .sort-mobile { display: flex; }

  /* A tabela vira uma lista de cartões, sem renderizar nada duas vezes. */
  .tickets thead { display: none; }
  .tickets, .tickets tbody, .tickets tr, .tickets td { display: block; }
  .tickets tr { position: relative; padding: var(--space-xs) var(--space-s); border-bottom: var(--border-size) solid var(--border); }
  .tickets td { display: flex; justify-content: space-between; gap: var(--space-s); padding: var(--space-3xs) 0; border: 0; }
  .tickets td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--step--1); flex: none; }
  .tickets td.cell-go { position: absolute; top: var(--space-xs); right: var(--space-s); padding: var(--space-3xs) 0; }
  .tickets td.cell-go::before, .tickets td.cell-first::before { content: none; }
  .tickets td.cell-main { display: block; min-width: 0; padding-right: var(--space-m); }
  .tickets td.cell-main::before { content: none; }
  .tickets .cell-person, .tickets .cell-nowrap { white-space: normal; text-align: right; }
}

@media (max-width: 560px) {
  .container { padding-inline: var(--space-s); }
  .brand-tag, .menu-name { display: none; }
  .topbar-inner { flex-wrap: wrap; row-gap: 0; }
  .topnav { order: 3; width: 100%; margin: 0 0 var(--space-3xs); }
  :root { --bar-name-width: 7.5rem; }
  .page-head .btn { width: 100%; }
  .toolbar { padding-inline: var(--space-xs); }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding-inline: var(--space-3xs); }
  .sort { width: 100%; }
  .sort .form-control { flex: 1; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog, .modal-lg { width: 100%; max-height: 94dvh; border-radius: var(--radius-3) var(--radius-3) 0 0; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot-spacer { display: none; }
  .message { max-width: 100%; }
}
