/* Funcionalidades do projeto atual (chat, login, logout) sobre o tema UX refatorado */

/* Detalhe do chamado: coluna da direita (ações + histórico) */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-self: start;
}

.detail-layout--readonly {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

.detail-history-card {
  padding: 0.85rem 0.9rem 0.95rem;
  min-width: 0;
  overflow: hidden;
}

.detail-history-card .section-header {
  margin-bottom: 0.65rem;
}

.timeline-compact {
  max-height: min(42vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin: 0;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.timeline-compact::-webkit-scrollbar {
  width: 7px;
}

.timeline-compact::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

.timeline-compact::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.timeline-compact::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}

.timeline-compact li {
  min-width: 0;
}

.timeline-compact .timeline-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.timeline-compact .timeline-time,
.timeline-compact .timeline-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.timeline-compact .timeline-content p {
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.timeline-compact .timeline-time {
  font-size: 0.62rem;
}

.timeline-compact .timeline-title {
  font-size: 0.72rem;
}

@media (min-width: 901px) {
  .detail-layout:not(.detail-layout--readonly) {
    gap: 0.85rem 1rem;
  }

  .detail-body {
    gap: 0.85rem;
  }
}

@media (max-width: 900px) {
  .detail-layout:not(.detail-layout--readonly) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
  }
}

.flash-stack--auth {
  max-width: none;
  margin-bottom: 0.85rem;
}

.readonly-block {
  display: grid;
  gap: 0.75rem;
}

.readonly-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.readonly-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-wrap;
}

.sidebar-account .icon-btn:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-soft);
}

.ticket-chat {
  padding: 0;
  overflow: hidden;
}

.ticket-chat .chat-card-head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--chat-header-bg);
}

.chat-card-title {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.chat-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 1px solid var(--primary-border-soft);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.chat-card-title h2 {
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
}

.chat-card-title p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.ticket-chat .chat-panel {
  padding: 1rem 1.15rem 1.1rem;
  background: var(--chat-panel-bg);
}

.ticket-chat .chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 6rem;
  max-height: 24rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.15rem 0.25rem 0.15rem 0;
  scrollbar-gutter: stable;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 100%;
}

.chat-message.is-staff {
  flex-direction: row-reverse;
}

.chat-message.is-staff .chat-message-body {
  align-items: flex-end;
}

.chat-message.is-staff .chat-meta {
  flex-direction: row-reverse;
}

.chat-avatar {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-soft);
  background: var(--chat-avatar-bg);
  color: var(--text-soft);
}

.is-staff .chat-avatar {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary-soft-strong);
  color: var(--chat-staff-text);
}

.is-requester .chat-avatar {
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  background: var(--success-soft);
  color: var(--chat-requester-text);
}

.chat-message-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: min(100%, 34rem);
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.chat-author {
  font-weight: 600;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.chat-role {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--chat-role-bg);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.is-staff .chat-time {
  margin-left: 0;
  margin-right: auto;
}

.chat-content {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--chat-message-bg);
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
}

.is-staff .chat-content {
  border-color: var(--primary-border-soft);
  background: var(--chat-staff-bg);
  border-bottom-right-radius: 4px;
}

.is-requester .chat-content {
  border-color: color-mix(in srgb, var(--success) 18%, transparent);
  background: var(--chat-requester-bg);
  border-bottom-left-radius: 4px;
}

.chat-thread-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-empty-icon {
  opacity: 0.55;
  margin-bottom: 0.25rem;
}

.chat-composer {
  margin: 0;
  padding: 0;
}

.chat-composer-card {
  padding: 0.75rem 0.85rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-2);
}

.chat-composer-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}

.chat-composer-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-composer-field .field-error {
  font-size: 0.68rem;
}

.chat-composer-field textarea,
.chat-composer-field .chat-textarea {
  width: 100%;
  min-height: 2.65rem;
  max-height: 9rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--form-bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 0.86rem;
  resize: vertical;
  box-sizing: border-box;
}

.chat-composer-field textarea:focus,
.chat-composer-field .chat-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
  outline: none;
}

.chat-composer-hint {
  margin: 0.45rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.chat-send {
  flex-shrink: 0;
  min-width: 5.5rem;
  min-height: 2.5rem;
  padding-inline: 0.85rem;
  margin: 0;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .chat-composer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-send {
    width: 100%;
    min-height: 2.65rem;
  }
}


/* Theme-aware chat refinements */
html[data-theme="light"] .ticket-chat .chat-card-head {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .chat-card-icon {
  color: var(--primary);
}
html[data-theme="light"] .chat-content {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
html[data-theme="light"] .chat-composer-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .chat-composer-field textarea,
html[data-theme="light"] .chat-composer-field .chat-textarea {
  background: #ffffff;
}

/* Lista de chamados: fundo suave por status */
.compact-ticket-table tr.ticket-row--status-aberto td {
  background: rgba(91, 143, 255, 0.07);
}

.compact-ticket-table tr.ticket-row--status-aguardando td,
.compact-ticket-table tr.ticket-row--status-em_atendimento td,
.compact-ticket-table tr.ticket-row--status-escalonado td {
  background: rgba(239, 183, 79, 0.09);
}

.compact-ticket-table tr.ticket-row--status-resolvido td,
.compact-ticket-table tr.ticket-row--status-fechado td {
  background: rgba(66, 201, 144, 0.08);
}

.compact-ticket-table tr.ticket-row--status-cancelado td {
  background: rgba(148, 163, 184, 0.06);
}

.compact-ticket-table tr.ticket-row--status-aberto:hover td {
  background: rgba(91, 143, 255, 0.11);
}

.compact-ticket-table tr.ticket-row--status-aguardando:hover td,
.compact-ticket-table tr.ticket-row--status-em_atendimento:hover td,
.compact-ticket-table tr.ticket-row--status-escalonado:hover td {
  background: rgba(239, 183, 79, 0.13);
}

.compact-ticket-table tr.ticket-row--status-resolvido:hover td,
.compact-ticket-table tr.ticket-row--status-fechado:hover td {
  background: rgba(66, 201, 144, 0.12);
}

.ticket-mobile-card.ticket-row--status-aberto {
  background: rgba(91, 143, 255, 0.07);
}

.ticket-mobile-card.ticket-row--status-aguardando,
.ticket-mobile-card.ticket-row--status-em_atendimento,
.ticket-mobile-card.ticket-row--status-escalonado {
  background: rgba(239, 183, 79, 0.09);
}

.ticket-mobile-card.ticket-row--status-resolvido,
.ticket-mobile-card.ticket-row--status-fechado {
  background: rgba(66, 201, 144, 0.08);
}

html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-aberto td {
  background: #eff6ff;
}

html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-aguardando td,
html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-em_atendimento td,
html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-escalonado td {
  background: #fffbeb;
}

html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-resolvido td,
html[data-theme="light"] .compact-ticket-table tr.ticket-row--status-fechado td {
  background: #f0fdf4;
}

html[data-theme="light"] .ticket-mobile-card.ticket-row--status-aberto {
  background: #eff6ff;
}

html[data-theme="light"] .ticket-mobile-card.ticket-row--status-aguardando,
html[data-theme="light"] .ticket-mobile-card.ticket-row--status-em_atendimento,
html[data-theme="light"] .ticket-mobile-card.ticket-row--status-escalonado {
  background: #fffbeb;
}

html[data-theme="light"] .ticket-mobile-card.ticket-row--status-resolvido,
html[data-theme="light"] .ticket-mobile-card.ticket-row--status-fechado {
  background: #f0fdf4;
}

/* Portal do solicitante */
.portal-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-icon.queue-icon {
  color: var(--primary);
  border-color: var(--primary-border-soft);
  background: var(--primary-soft);
}

html[data-theme="light"] .kpi-icon.queue-icon {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.18);
}

.kpi-card.kpi-link.is-active {
  border-color: var(--primary-border-soft);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary-border-soft);
}

@media (max-width: 760px) {
  .portal-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Fila de chamados */
.ticket-filter-primary--portal {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
}

.ticket-filter-primary .clear-filter {
  align-self: end;
  justify-self: start;
  min-height: 34px;
  margin: 0;
  white-space: nowrap;
}

.filter-hint {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .ticket-filter-primary--portal {
    grid-template-columns: 1fr;
  }

  .ticket-filter-primary--portal .clear-filter {
    width: fit-content;
  }
}

/* Lista de chamados: alinhar cabeçalho e células por coluna */
.compact-ticket-table th,
.compact-ticket-table td {
  vertical-align: middle;
}

.compact-ticket-table th:nth-child(1),
.compact-ticket-table th:nth-child(2),
.compact-ticket-table th:nth-child(3),
.compact-ticket-table th:nth-child(6),
.compact-ticket-table td:nth-child(1),
.compact-ticket-table td:nth-child(2),
.compact-ticket-table td:nth-child(3),
.compact-ticket-table td:nth-child(6) {
  text-align: left;
}

.compact-ticket-table th:nth-child(4),
.compact-ticket-table th:nth-child(5),
.compact-ticket-table th.col-fixar,
.compact-ticket-table td:nth-child(4),
.compact-ticket-table td:nth-child(5),
.compact-ticket-table td.col-fixar {
  text-align: center;
}

.compact-ticket-table td:nth-child(4) .prio-badge,
.compact-ticket-table td:nth-child(5) .badge {
  margin-inline: auto;
}

/* Prioridade: pill sólida, texto branco */
.badge.prio-badge {
  min-height: 24px;
  min-width: 4.25rem;
  justify-content: center;
  padding: 0.2rem 0.58rem;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  border-width: 1.5px;
  letter-spacing: 0.015em;
  color: #fff;
}

.badge.prio-badge.prio-baixa,
html[data-theme="light"] .badge.prio-badge.prio-baixa {
  color: #fff;
  background: #16a34a;
  border-color: #15803d;
}

.badge.prio-badge.prio-media,
html[data-theme="light"] .badge.prio-badge.prio-media {
  color: #fff;
  background: #2563eb;
  border-color: #1d4ed8;
}

.badge.prio-badge.prio-alta,
html[data-theme="light"] .badge.prio-badge.prio-alta {
  color: #fff;
  background: #d97706;
  border-color: #b45309;
}

.badge.prio-badge.prio-urgente,
html[data-theme="light"] .badge.prio-badge.prio-urgente {
  color: #fff;
  background: #dc2626;
  border-color: #b91c1c;
}

/* Cabeçalho da lista de chamados — contador no canto */
.ticket-list-header {
  align-items: flex-start;
  width: 100%;
  gap: 1rem;
}

.ticket-list-header__copy {
  flex: 1;
  min-width: 0;
}

.ticket-list-header__meta {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  padding-top: 0.05rem;
}

.lista-count-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 0.4rem 0.7rem 0.38rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: 0 1px 2px rgba(8, 17, 30, 0.06);
  text-align: center;
  line-height: 1.1;
}

.lista-count-chip__value {
  font-size: 1.12rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.lista-count-chip__label {
  margin-top: 0.12rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lista-loading {
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme="light"] .lista-count-chip {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .lista-count-chip__value {
  color: #0f172a;
}

/* Ordenação por coluna */
.compact-ticket-table .th-sortable {
  padding: 0.46rem 0.56rem;
  vertical-align: middle;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 0.32rem;
  width: auto;
  max-width: 100%;
  min-height: 1.35rem;
  padding: 0.12rem 0.2rem;
  margin: -0.12rem -0.2rem;
  border: none;
  border-radius: 0.35rem;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s ease, background 0.15s ease;
}

.compact-ticket-table th.th-sortable:nth-child(1) .th-sort,
.compact-ticket-table th.th-sortable:nth-child(2) .th-sort,
.compact-ticket-table th.th-sortable:nth-child(3) .th-sort,
.compact-ticket-table th.th-sortable:nth-child(6) .th-sort {
  justify-content: flex-start;
}

.compact-ticket-table th.th-sortable:nth-child(4) .th-sort,
.compact-ticket-table th.th-sortable:nth-child(5) .th-sort {
  justify-content: center;
}

.th-sort:hover {
  color: var(--text-soft);
  background: rgba(148, 163, 184, 0.08);
}

.th-sort-icons {
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0;
  opacity: 0.35;
  line-height: 0;
}

.th-sort-icons .icon {
  width: 11px;
  height: 11px;
}

.th-sortable.is-sorted .th-sort {
  color: var(--primary);
}

.th-sortable.is-sorted .th-sort-icons {
  opacity: 1;
}

.th-sortable.is-sorted.is-asc .th-sort-icons .icon:first-child {
  color: var(--primary);
  opacity: 1;
}

.th-sortable.is-sorted.is-asc .th-sort-icons .icon:last-child {
  opacity: 0.25;
}

.th-sortable.is-sorted.is-desc .th-sort-icons .icon:last-child {
  color: var(--primary);
  opacity: 1;
}

.th-sortable.is-sorted.is-desc .th-sort-icons .icon:first-child {
  opacity: 0.25;
}

/* Paginação da lista */
.lista-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-soft);
}

.lista-pagination__summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.lista-pagination__summary--solo {
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-soft);
}

.lista-pagination__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lista-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.45rem;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.68rem;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.lista-page-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border-soft);
  background: var(--primary-soft);
}

.lista-page-btn.is-disabled {
  opacity: 0.45;
  cursor: default;
}

.lista-page-status {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Fixar chamado no topo da fila (equipe) */
.compact-ticket-table .col-fixar {
  width: 2.75rem;
  padding-left: 0.35rem;
  padding-right: 0.45rem;
  text-align: center;
  vertical-align: middle;
}

.pin-form {
  margin: 0;
  display: inline-flex;
  justify-content: center;
}

.pin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.pin-toggle .icon {
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.pin-toggle:hover {
  color: var(--primary);
  background: rgba(91, 143, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(91, 143, 255, 0.14);
}

.pin-toggle:hover .icon {
  transform: scale(1.07) rotate(-12deg);
}

.pin-toggle:active .icon {
  transform: scale(0.94) rotate(-8deg);
}

.pin-toggle.is-pinned {
  color: var(--primary-button);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary-border-soft);
}

.pin-toggle.is-pinned .icon {
  transform: rotate(-32deg);
}

.pin-toggle.is-pinned .icon path:last-child {
  fill: currentColor;
  fill-opacity: 0.18;
}

.pin-toggle.is-pinned:hover {
  background: var(--primary-soft-strong);
  box-shadow: 0 0 0 1px var(--primary-border-soft), 0 2px 8px rgba(91, 143, 255, 0.12);
}

.pin-toggle.is-pinned:hover .icon {
  transform: rotate(-26deg) scale(1.05);
}

.pin-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html[data-theme="light"] .pin-toggle:hover {
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .pin-toggle.is-pinned:hover {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.1);
}

.ticket-row--pinned td:first-child .protocol-link::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: var(--primary);
  vertical-align: 0.15em;
}

.ticket-mobile-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ticket-mobile-body-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ticket-mobile-body-link:hover .protocol-link {
  color: var(--link-hover);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Novo chamado — solicitante */
.chamado-solicitante-select-slot {
  flex: 1;
  min-width: 0;
}

.chamado-solicitante-select-slot .chamado-solicitante-select {
  width: 100%;
}

.chamado-solicitante-portal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--surface-elevated, #f8fafc);
}

.chamado-solicitante-portal-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
}

.chamado-solicitante-portal-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.chamado-solicitante-portal-text span {
  font-size: 0.86rem;
  color: var(--text-muted, #64748b);
}


/* Meu perfil */
.sidebar-account {
  grid-template-columns: minmax(0, 1fr) 34px;
}
.sidebar-account-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
  margin: -.3rem;
  padding: .3rem;
  border-radius: 8px;
  color: inherit;
  transition: background 120ms ease, box-shadow 120ms ease;
}
.sidebar-account-link:hover {
  color: inherit;
  background: var(--nav-hover);
}
.sidebar-account.is-profile-active {
  border-color: var(--primary-border-soft);
  background: var(--primary-soft);
}
.sidebar-account.is-profile-active .account-avatar {
  box-shadow: 0 0 0 1px var(--primary-border-soft);
}
.profile-page {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
}
.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.2rem;
  margin-bottom: .75rem;
}
.profile-summary-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.profile-avatar-large {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary-border-soft);
  border-radius: 15px;
  color: var(--avatar-text);
  background: var(--primary-soft-strong);
  font-size: 1.15rem;
  font-weight: 800;
}
.profile-summary-copy { min-width: 0; }
.profile-summary-copy h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.08rem;
  letter-spacing: -.015em;
}
.profile-summary-copy p {
  margin: .16rem 0 .45rem;
  overflow: hidden;
  color: var(--muted);
  font-size: .73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.profile-account-state {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .7rem;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface-2);
}
.profile-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}
.profile-account-state div {
  display: flex;
  flex-direction: column;
}
.profile-account-state strong { color: var(--text-soft); font-size: .72rem; }
.profile-account-state small { color: var(--muted); font-size: .62rem; }
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  gap: .75rem;
  align-items: start;
}
.profile-card {
  min-width: 0;
}
.profile-card-head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-bottom: .9rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-soft);
}
.profile-card-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary-border-soft);
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}
.profile-card-head h2 {
  margin: 0;
  color: var(--text);
  font-size: .9rem;
}
.profile-card-head p {
  margin: .16rem 0 0;
  color: var(--muted);
  font-size: .68rem;
}
.profile-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.profile-readonly-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .08rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.profile-readonly-item > span {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 650;
}
.profile-readonly-item strong {
  color: var(--text-soft);
  font-size: .75rem;
}
.profile-readonly-item small {
  margin-top: .12rem;
  color: var(--muted-2);
  font-size: .6rem;
  line-height: 1.35;
}
.profile-security-note {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding: .6rem .65rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: .65rem;
  line-height: 1.4;
}
.profile-security-note .icon {
  margin-top: .05rem;
  color: var(--primary);
}
@media (max-width: 900px) {
  .profile-page {
    max-width: none;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .profile-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-account-state {
    width: 100%;
  }
  .profile-summary-copy p {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .profile-readonly-grid {
    grid-template-columns: 1fr;
  }
}


/* Relatório mensal v2 */
.report-page {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
}
.report-period-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
}
.report-period-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.report-period-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary-border-soft);
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-soft);
}
.report-period-identity h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1rem;
  line-height: 1.2;
}
.report-period-identity p {
  margin: .18rem 0 0;
  color: var(--muted);
  font-size: .68rem;
}
.report-period-form {
  display: grid;
  grid-template-columns: 92px 102px auto auto;
  gap: .45rem;
  align-items: end;
}
.report-period-form .btn { white-space: nowrap; }

.report-kpi-grid-v2 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .6rem;
  margin-bottom: .75rem;
}
.report-kpi {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  min-height: 86px;
  padding: .72rem .78rem;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--surface);
}
.report-kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary-border-soft);
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
}
.report-kpi > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .05rem .45rem;
  align-items: baseline;
}
.report-kpi span:not(.report-kpi-icon) {
  overflow: hidden;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 680;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-kpi strong {
  grid-row: span 2;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -.04em;
}
.report-kpi small {
  color: var(--muted-2);
  font-size: .58rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-kpi--success .report-kpi-icon {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
  background: var(--success-soft);
}
.report-kpi--warning .report-kpi-icon {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
  background: var(--warning-soft);
}
.report-kpi--info .report-kpi-icon {
  color: var(--violet);
  border-color: color-mix(in srgb, var(--violet) 22%, transparent);
  background: color-mix(in srgb, var(--violet) 8%, transparent);
}

.report-insights-grid {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: .75rem;
  margin-bottom: .75rem;
}
.report-insight-card,
.report-activity-card,
.report-secondary-card {
  padding: .9rem .95rem;
}
.report-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .75rem;
}
.report-card-heading h2 {
  margin: 0;
  color: var(--heading);
  font-size: .9rem;
  line-height: 1.25;
}
.report-card-heading p {
  margin: .16rem 0 0;
  color: var(--muted);
  font-size: .66rem;
}
.report-type-list {
  display: grid;
  gap: .6rem;
}
.report-type-row { min-width: 0; }
.report-type-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .24rem;
  color: var(--text-soft);
  font-size: .69rem;
}
.report-type-line strong {
  color: var(--heading);
  font-size: .72rem;
}
.report-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.report-progress > span {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.report-distribution-v2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.report-dist-group {
  min-width: 0;
  padding: .65rem .68rem;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.report-dist-group h3 {
  margin: 0 0 .38rem;
  color: var(--section-label);
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.report-dist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 25px;
  padding: .18rem 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-size: .66rem;
}
.report-dist-row:last-child { border-bottom: 0; }
.report-dist-row span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-dist-row strong {
  min-width: 24px;
  padding: .08rem .32rem;
  border-radius: 6px;
  color: var(--heading);
  background: var(--surface-2);
  text-align: center;
  font-size: .64rem;
}
.report-empty-inline {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .64rem;
}
.report-activity-card {
  margin-bottom: .75rem;
  overflow: hidden;
}
.report-activity-heading { align-items: center; }
.report-count-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: .28rem;
  padding: .38rem .56rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-2);
}
.report-count-pill strong {
  color: var(--heading);
  font-size: .9rem;
}
.report-count-pill span {
  color: var(--muted);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.report-activity-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.report-activity-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .7rem;
}
.report-activity-table th {
  padding: .48rem .55rem;
  color: var(--table-head-text);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border-soft);
  font-size: .58rem;
  font-weight: 760;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.report-activity-table td {
  padding: .55rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.report-activity-table tbody tr:not(.report-activity-detail-row):hover td {
  background: var(--table-row-hover);
}
.report-cell-primary {
  display: block;
  color: var(--text-soft);
  font-size: .69rem;
  font-weight: 680;
}
.report-cell-meta {
  display: block;
  margin-top: .08rem;
  color: var(--muted);
  font-size: .59rem;
  line-height: 1.35;
}
.report-activity-detail-row td {
  padding: 0 .55rem .5rem;
  background: var(--surface);
}
.report-activity-detail {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  padding: .42rem .5rem;
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: .63rem;
  line-height: 1.45;
}
.report-activity-detail > span {
  min-width: 0;
  flex: 1 1 320px;
}
.report-activity-detail strong {
  margin-right: .38rem;
  color: var(--text-soft);
  font-size: .59rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.report-activity-detail .is-solution {
  color: var(--text-soft);
}
.report-activity-detail .is-solution strong { color: var(--success); }

.report-secondary-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.report-secondary-list {
  display: grid;
  gap: .48rem;
}
.report-secondary-item {
  padding: .62rem .68rem;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.report-secondary-item.is-pending {
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
  background: var(--warning-soft);
}
.report-secondary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .28rem;
}
.report-secondary-item > strong {
  display: block;
  color: var(--text-soft);
  font-size: .7rem;
}
.report-secondary-item p {
  margin: .16rem 0 .28rem;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.45;
}
.report-secondary-item small {
  color: var(--muted-2);
  font-size: .58rem;
}
.report-empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .25rem;
  color: var(--muted);
  text-align: center;
}
.report-empty-state .icon { opacity: .55; }
.report-empty-state strong {
  color: var(--text-soft);
  font-size: .72rem;
}
.report-empty-state span { font-size: .63rem; }
.report-empty-state.compact { min-height: 88px; }

@media (max-width: 1180px) {
  .report-kpi-grid-v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-insights-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .report-period-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .report-period-form {
    grid-template-columns: 1fr 1fr auto auto;
  }
  .report-secondary-grid-v2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .report-kpi-grid-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-kpi-grid-v2 .report-kpi:last-child {
    grid-column: 1 / -1;
  }
  .report-distribution-v2 {
    grid-template-columns: 1fr;
  }
  .report-activity-table th:nth-child(4),
  .report-activity-table th:nth-child(6),
  .report-activity-table td:nth-child(4),
  .report-activity-table td:nth-child(6) {
    display: none;
  }
}
@media (max-width: 620px) {
  .report-period-identity {
    align-items: flex-start;
  }
  .report-period-form {
    grid-template-columns: 1fr 1fr;
  }
  .report-period-form .btn,
  .report-period-form .report-export-btn {
    width: 100%;
  }
  .report-kpi-grid-v2 {
    grid-template-columns: 1fr;
  }
  .report-kpi-grid-v2 .report-kpi:last-child {
    grid-column: auto;
  }
  .report-activity-table th:nth-child(3),
  .report-activity-table td:nth-child(3) {
    display: none;
  }
  .report-activity-detail {
    display: grid;
  }
}


@media (max-width: 620px) {
  .report-period-form .btn,
  .report-period-form .report-export-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}


@media (max-width: 620px) {
  .report-kpi {
    width: 100%;
    overflow: hidden;
  }
  .report-kpi > div {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .report-kpi strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;
  }
}


/* Relatório mensal: lista de chamados mais compacta */
.report-activity-card {
  padding: .72rem .8rem;
}
.report-activity-card .report-card-heading {
  margin-bottom: .52rem;
}
.report-activity-table {
  font-size: .66rem;
}
.report-activity-table th {
  padding: .36rem .46rem;
  font-size: .54rem;
}
.report-activity-table td {
  padding: .34rem .46rem;
}
.report-cell-primary {
  font-size: .64rem;
  line-height: 1.22;
}
.report-cell-meta {
  margin-top: .03rem;
  font-size: .54rem;
  line-height: 1.22;
}
.report-activity-table .protocol-link {
  font-size: .63rem;
}
.report-activity-table .badge {
  min-height: 19px;
  padding: .08rem .38rem;
  font-size: .56rem;
}
.report-activity-table .badge.prio-badge {
  min-width: 3.65rem;
  min-height: 20px;
  padding: .1rem .42rem;
  font-size: .58rem;
}
.report-activity-detail-row td {
  padding: 0 .46rem .26rem;
}
.report-activity-detail {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .3rem .7rem;
  min-height: 24px;
  padding: .22rem .4rem;
  border-radius: 6px;
  font-size: .57rem;
  line-height: 1.25;
}
.report-activity-detail > span {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex: 1 1 0;
  overflow: hidden;
}
.report-activity-detail strong {
  flex: 0 0 auto;
  margin-right: .3rem;
  font-size: .52rem;
}
.report-detail-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-activity-table tbody tr:not(.report-activity-detail-row) td {
  height: 38px;
}
.report-count-pill {
  padding: .28rem .46rem;
}
.report-count-pill strong {
  font-size: .8rem;
}
.report-count-pill span {
  font-size: .52rem;
}

@media (max-width: 760px) {
  .report-activity-card {
    padding: .7rem;
  }
  .report-activity-detail {
    display: grid;
    gap: .2rem;
  }
  .report-activity-detail > span {
    display: flex;
    width: 100%;
  }
}


/* Paginação do relatório mensal */
.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid var(--border-soft);
}
.report-pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: .61rem;
}
.report-pagination-summary strong {
  color: var(--text-soft);
  font-weight: 720;
}
.report-pagination-controls,
.report-page-numbers {
  display: flex;
  align-items: center;
  gap: .28rem;
}
.report-page-nav,
.report-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: .6rem;
  font-weight: 680;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.report-page-nav {
  padding: .26rem .52rem;
}
.report-page-number {
  width: 28px;
  padding: 0;
}
.report-page-nav:hover,
.report-page-number:hover {
  color: var(--primary);
  border-color: var(--primary-border-soft);
  background: var(--primary-soft);
}
.report-page-number.is-active {
  color: var(--primary-contrast);
  border-color: var(--primary-button);
  background: var(--primary-button);
}
.report-page-nav.is-disabled {
  opacity: .42;
  cursor: default;
}
.report-page-ellipsis {
  min-width: 18px;
  color: var(--muted);
  font-size: .62rem;
  text-align: center;
}
@media (max-width: 620px) {
  .report-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .report-pagination-controls {
    justify-content: space-between;
    width: 100%;
  }
  .report-page-numbers {
    justify-content: center;
    flex: 1;
  }
}


/* Seletor de competência do relatório */
.report-period-form {
  grid-template-columns: 170px auto auto;
}
.report-competencia-field {
  min-width: 170px;
}
.report-competencia-field input[type="month"] {
  width: 100%;
  min-width: 170px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.report-competencia-field input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .72;
}
.report-competencia-field input[type="month"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

@media (max-width: 900px) {
  .report-period-form {
    grid-template-columns: minmax(180px, 1fr) auto auto;
  }
}
@media (max-width: 620px) {
  .report-period-form {
    grid-template-columns: 1fr;
  }
  .report-competencia-field,
  .report-competencia-field input[type="month"] {
    min-width: 0;
    width: 100%;
  }
  .report-period-form .btn,
  .report-period-form .report-export-btn {
    grid-column: auto;
  }
}


/* Relatório mensal: aproveitar toda a largura útil da aplicação */
.main:has(.report-page) {
  padding-left: clamp(.7rem, 1vw, 1rem);
  padding-right: clamp(.7rem, 1vw, 1rem);
}
.main:has(.report-page) .topbar,
.main:has(.report-page) .page-content,
.main:has(.report-page) .flash-stack {
  max-width: none;
}
.main:has(.report-page) .topbar,
.main:has(.report-page) .page-content {
  width: 100%;
  margin-inline: 0;
}
.report-page {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.report-page .report-period-panel,
.report-page .report-kpi-grid-v2,
.report-page .report-insights-grid,
.report-page .report-activity-card,
.report-page .report-secondary-grid-v2 {
  width: 100%;
}
.report-page .report-insights-grid {
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.55fr);
  gap: .65rem;
}
.report-page .report-kpi-grid-v2 {
  gap: .5rem;
}
.report-page .report-period-panel {
  margin-bottom: .6rem;
}
.report-page .report-kpi-grid-v2,
.report-page .report-insights-grid {
  margin-bottom: .6rem;
}
@media (max-width: 1180px) {
  .report-page .report-insights-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .main:has(.report-page) {
    padding-inline: .72rem;
  }
}


/* Layout amplo global: aproveitar melhor monitores grandes */
@media (min-width: 901px) {
  .main {
    padding-left: clamp(.7rem, 1vw, 1rem);
    padding-right: clamp(.7rem, 1vw, 1rem);
  }
  .topbar,
  .page-content,
  .flash-stack {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }
}
.equipamentos-page,
.profile-page {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.registry-card {
  width: 100%;
  max-width: none;
}
.report-competencia-field,
.report-competencia-field label,
.report-competencia-field input[type="month"] {
  cursor: pointer;
}


/* Meu perfil: dados administrativos somente leitura */
.profile-readonly-grid--account {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .profile-readonly-grid--account {
    grid-template-columns: 1fr;
  }
}


/* Catálogo / gerenciar opções em campo (modal + select com +) */
.equip-catalog-field .equip-catalog-select-wrap {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--form-bg);
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.equip-catalog-field .equip-catalog-select-wrap:focus-within {
  border-color: var(--primary);
  background: var(--form-bg-focus);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

.equip-catalog-field.has-error .equip-catalog-select-wrap {
  border-color: var(--danger);
  box-shadow: none;
}

.equip-catalog-field .equip-catalog-select-wrap .equip-catalog-select,
.equip-catalog-field .equip-catalog-select-wrap .chamado-solicitante-select-slot .equip-catalog-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.equip-catalog-field .equip-catalog-select-wrap .equip-catalog-select:focus,
.equip-catalog-field .equip-catalog-select-wrap .chamado-solicitante-select-slot .equip-catalog-select:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}

.equip-catalog-field .equip-catalog-select-wrap .chamado-solicitante-select-slot {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}

.equip-catalog-manage.icon-btn {
  flex: 0 0 auto;
  align-self: stretch;
  width: 40px;
  min-height: 38px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  color: var(--primary);
  background: var(--primary-soft);
}

.equip-catalog-manage.icon-btn:hover {
  color: var(--primary);
  border-color: var(--border);
  background: var(--primary-soft-strong);
}

.equip-catalog-modal-backdrop {
  z-index: 120;
}

.equip-catalog-modal {
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 820px);
}

.equip-catalog-modal-header {
  flex-shrink: 0;
}

.equip-catalog-modal-icon {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border-soft);
}

.equip-catalog-modal-heading-text {
  min-width: 0;
}

.equip-catalog-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.equip-catalog-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--primary-border-soft);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--primary-soft);
}

.equip-catalog-meta-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}

.equip-catalog-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.82rem 0.9rem 0.9rem;
}

.equip-catalog-panel {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
}

.equip-catalog-panel--add {
  padding: 0.72rem 0.75rem 0.78rem;
}

.equip-catalog-add-head {
  margin-bottom: 0.55rem;
}

.equip-catalog-add-head h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--heading);
  font-size: 0.78rem;
  font-weight: 700;
}

.equip-catalog-add-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.equip-catalog-add-form {
  margin: 0;
}

.equip-catalog-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: start;
}

.equip-catalog-input-group-field {
  width: 100%;
  min-height: 36px;
  padding: 0.45rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.72rem;
  background: var(--input-bg);
}

.equip-catalog-input-group-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.equip-catalog-input-group.has-error .equip-catalog-input-group-field {
  border-color: var(--danger);
}

.equip-catalog-add-btn {
  white-space: nowrap;
}

.equip-catalog-panel--list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.72rem 0.75rem 0.78rem;
}

.equip-catalog-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.equip-catalog-panel-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.equip-catalog-panel-title h3 {
  margin: 0;
  color: var(--heading);
  font-size: 0.78rem;
  font-weight: 700;
}

.equip-catalog-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
  background: var(--surface-2);
}

.equip-catalog-search {
  flex: 1 1 180px;
  max-width: 240px;
}

.equip-catalog-search input {
  width: 100%;
  min-height: 34px;
  padding-left: 2rem;
  font-size: 0.7rem;
}

.equip-catalog-list-region {
  max-height: min(42vh, 18rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.equip-catalog-items {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.equip-catalog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.42rem 0.48rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.equip-catalog-item-edit {
  margin: 0;
  min-width: 0;
}

.equip-catalog-edit-input {
  width: 100%;
  min-height: 32px;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.7rem;
  background: transparent;
}

.equip-catalog-edit-input:focus {
  outline: none;
  border-color: var(--border);
  background: var(--input-bg);
}

.equip-catalog-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
}

.equip-catalog-action {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.equip-catalog-action:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

.equip-catalog-action--save:hover {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: var(--success-soft);
}

.equip-catalog-action--delete:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-soft);
}

.equip-catalog-filter-empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

.equip-catalog-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0.75rem;
  color: var(--muted);
  text-align: center;
}

.equip-catalog-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--icon-muted);
  background: var(--surface-2);
}

.equip-catalog-empty p {
  margin: 0;
  max-width: 16rem;
  font-size: 0.66rem;
  line-height: 1.45;
}

.equip-catalog-footer {
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
}

.equip-catalog-footer-note {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.cadastro-campo-badge {
  font-size: 0.58rem;
}

@media (max-width: 620px) {
  .equip-catalog-input-group {
    grid-template-columns: 1fr;
  }

  .equip-catalog-item {
    grid-template-columns: 1fr;
  }

  .equip-catalog-item-actions {
    justify-content: flex-start;
  }

  .equip-catalog-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .equip-catalog-footer .btn {
    width: 100%;
  }
}

/* Estado ativo/inativo nos modais de gerenciamento */
.equip-catalog-action--status {
  border: 1px solid transparent;
}

.equip-catalog-action--status.is-active {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.equip-catalog-action--status.is-active:hover {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.equip-catalog-action--status.is-inactive {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.equip-catalog-action--status.is-inactive:hover {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}


/* Estados do botão de ativação — compatível com light/dark */
.equip-catalog-action--status.is-active {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.equip-catalog-action--status.is-active:hover {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 16%, transparent);
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
}
.equip-catalog-action--status.is-inactive {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.equip-catalog-action--status.is-inactive:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

/* Especificações técnicas (accordion no modal de equipamento) */
.modal-form--stacked {
  gap: 0.55rem;
}

.equip-specs-disclosure {
  margin: 0.15rem 0 0.35rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.equip-specs-disclosure-trigger {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  transition: background 120ms ease;
}

.equip-specs-disclosure-trigger::-webkit-details-marker {
  display: none;
}

.equip-specs-disclosure-trigger::marker {
  content: "";
}

.equip-specs-disclosure-trigger:hover {
  background: var(--nav-hover);
}

.equip-specs-disclosure[open] > .equip-specs-disclosure-trigger {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-soft);
}

.equip-specs-disclosure-title {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
  text-align: left;
}

.equip-specs-disclosure-title strong {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
}

.equip-specs-disclosure-title small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 400;
  line-height: 1.35;
}

.equip-specs-chevron {
  flex-shrink: 0;
  color: var(--muted-2);
  font-size: 0.92rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 120ms ease;
}

.equip-specs-disclosure[open] .equip-specs-chevron {
  transform: rotate(180deg) translateY(1px);
}

.equip-specs-disclosure-body {
  padding: 0.75rem 0.85rem 0.85rem;
}

.equip-specs-disclosure-body .form-grid {
  max-width: none;
}

.equip-specs-hint {
  margin: 0 0 0.45rem;
}
