/* @layer-wrapped:overrides */
@layer overrides {
.dashboard {
  height: 100vh;
  overflow: hidden;
}

.dashboard-app {
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Badge "Tipo de link": as cores semanticas (verde/ambar) ficam na layer
   overrides porque a regra `.device-monitor-page .device-asset-main__meta span`
   (layer pages) pinta TODA span do meta como chip azul. Layer pages > components,
   entao a variante precisa vencer daqui. O layout base fica em components.css. */
.link-role-badge--principal {
  color: var(--color-success-text);
  background: var(--color-success-soft);
  border-color: var(--color-success-200);
}

.link-role-badge--backup {
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
  border-color: var(--color-warning-200);
}

.dashboard-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background-color: var(--custom-home-panel-bg-color, var(--color-bg));
  background-image: var(--custom-home-panel-bg-image, none);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.dashboard-nav {
  width: 238px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--custom-nav-bg, var(--color-nav));
  transition: width 0.22s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.dashboard-nav header {
  background-color: var(--custom-profile-button-bg, #6c757d) !important;
}

.dashboard-nav-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#company-locations-menu,
#company-locations-menu .dashboard-nav-dropdown,
#company-locations-menu .dashboard-nav-dropdown-menu {
  background: var(--custom-nav-bg, var(--color-nav));
}

#company-locations-menu {
  display: flex;
  flex-direction: column;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown.bg-secondary {
  background-color: var(--custom-profile-button-bg, #6c757d) !important;
}

.dashboard-nav-loading .dashboard-nav-item {
  opacity: 0.84;
}

.dashboard-brand-group {
  padding-top: 0.2rem;
}

.dashboard-brand-toggle {
  min-height: 2.3rem;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
  color: var(--color-nav-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dashboard-brand-toggle i {
  color: var(--color-nav-text-muted);
}

.dashboard-brand-label {
  flex: 1 1 auto;
}

.dashboard-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin-left: -40px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dashboard-brand-mark img {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
}

.dashboard-brand-mark i {
  font-size: 0.95rem;
}

.dashboard-store-group .dashboard-nav-item {
  min-height: 2.35rem;
  padding-top: 0.46rem;
  padding-bottom: 0.46rem;
}

.dashboard-store-toggle {
  color: rgba(226, 232, 240, 0.76);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.dashboard-location-label {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-store-toggle i,
.dashboard-brand-toggle i {
  flex: 0 0 1rem;
  font-size: 0.95rem;
}

.menu-icon-large {
  font-size: 2rem !important;
  margin-right: 5px;
}

.menu-icon-image-large {
  width: 2.2rem;
  height: 2.2rem;
  object-fit: contain;
  margin-left: -40px;
  flex: 0 0 36px;
}

#vpn .dashboard-nav-item,
#usCall .dashboard-nav-item,
#admin-nav {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.location-group-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 56px;
  flex: 0 0 88px;
  border-radius: 14px;
  padding: 0.45rem;
  background: var(--custom-thumbnail-bg, #f8fafc);
  border: 1px solid rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.location-group-logo.is-empty {
  color: #94a3b8;
}

.location-group-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dashboard-nav-dropdown-toggle {
  gap: 0.6rem;
}

.dashboard-nav-dropdown-item {
  min-height: 2.45rem;
  padding-top: 0.52rem;
  padding-bottom: 0.52rem;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dashboard-nav-dropdown-item:hover {
  background: rgba(37, 99, 235, 0.14);
  color: #ffffff;
  transform: translateX(2px);
}

#dash input[type="file"] {
  display: block;
}

.brand-logo img {
  width: 100%;
  max-width: 100px;
  height: auto;
  margin-right: 0;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.dashboard-toolbar-start {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.dashboard-toolbar h1 {
  margin: 0;
  padding-left: 0;
  text-align: left;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f8fafc;
  text-shadow: 0 1px 10px rgba(15, 23, 42, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.dashboard-toolbar-title-fixed {
  display: inline-block;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

#dashboard-button {
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  background-color: var(--custom-profile-button-bg, #6c757d);
}

#admin-nav {
  background-color: var(--custom-profile-button-bg, #6c757d);
  color: #ffffff;
}

#dash .card-header.bg-primary,
#dash .card-header.bg-secondary,
#dash .card-header.bg-success {
  background-color: var(--custom-admin-header-bg, #6c757d) !important;
  color: #fff !important;
}

#dashboard-button span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-content {
  background-size: cover;
  background-position: center center;
}

#dash {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1rem, 2vw, 2rem);
}

#dash.dash-layout-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dash-toolbar-actions {
  display: flex;
  justify-content: flex-end;
}

.dash-toolbar-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  border-radius: 12px;
  padding-inline: 1rem;
}

.dash-device-card {
  border-radius: 16px;
}

.dash-device-card .list-group-item {
  padding: 0.85rem 1rem;
}

.status-chip {
  width: auto;
}

.status-offline {
  background: linear-gradient(90deg, rgba(194, 12, 12, 0.14), rgba(255, 59, 59, 0.12));
  color: #be123c;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.12);
  animation: heartbeat 0.8s infinite;
}

.status-offline .status-dot {
  background-color: #ef4444;
  animation: heartbeat 0.8s infinite;
}

.status-attending {
  color: #b45309;
}

.status-attending .status-dot {
  background-color: #f59e0b;
}

.status-unstable {
  color: #7c3aed;
}

.status-unstable .status-dot {
  background-color: #8b5cf6;
}

.mobile-monitor-table {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--color-surface);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
}

.mobile-monitor-head,
.mobile-monitor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(92px, 0.9fr) minmax(108px, 0.9fr);
  align-items: center;
}

.mobile-monitor-head {
  background: #111827;
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-monitor-head-cell,
.mobile-monitor-cell {
  padding: 0.95rem 1rem;
}

.mobile-monitor-body {
  display: flex;
  flex-direction: column;
}

.mobile-monitor-row {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.mobile-monitor-row:nth-child(even) {
  background: var(--color-surface-muted);
}

.mobile-monitor-value {
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}

.mobile-monitor-cell-ip .mobile-monitor-value,
.mobile-monitor-cell-ip a {
  color: #2563eb;
  text-decoration: none;
  word-break: break-word;
}

.mobile-monitor-meta {
  margin-top: 0.18rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.mobile-monitor-cell-status {
  display: flex;
  justify-content: flex-start;
}

.monitoring-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
}

.monitoring-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(auto-fit, minmax(150px, 0.7fr));
  gap: 0.9rem;
  align-items: end;
}

.monitoring-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.monitoring-summary-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.monitoring-summary-card[data-monitoring-summary-card] {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.monitoring-summary-card[data-monitoring-summary-card]:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.monitoring-summary-card[data-monitoring-summary-card].is-active {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.12);
}

.monitoring-summary-card[data-monitoring-summary-card].is-active .monitoring-summary-icon {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.monitoring-summary-card[data-monitoring-summary-card]:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.28);
  outline-offset: 3px;
}

.monitoring-summary-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.monitoring-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.monitoring-summary-copy span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.monitoring-summary-copy strong {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
}

.monitoring-summary-copy small {
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.35;
}

.monitoring-summary-card.is-offline .monitoring-summary-icon {
  background: rgba(251, 113, 133, 0.14);
  color: #be123c;
}

.monitoring-summary-card.is-offline .monitoring-summary-copy strong {
  color: #be123c;
}

.monitoring-summary-card.is-attending .monitoring-summary-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.monitoring-summary-card.is-attending .monitoring-summary-copy strong {
  color: #b45309;
}

.monitoring-summary-card.is-unstable .monitoring-summary-icon {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}

.monitoring-summary-card.is-unstable .monitoring-summary-copy strong {
  color: #6d28d9;
}

.monitoring-control-search,
.monitoring-control-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.monitoring-control-search {
  position: relative;
}

.monitoring-control-search i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.monitoring-control-search .form-control {
  min-height: 44px;
  border-radius: 14px;
  padding-left: 2.6rem;
  border-color: rgba(148, 163, 184, 0.3);
}

.monitoring-control-field span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.monitoring-control-field .form-select {
  min-height: 44px;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.3);
}

.monitoring-data-table {
  min-width: 760px;
  margin: 0;
}

.monitoring-data-table thead th {
  background: #111827;
  color: #f8fafc;
  border: 0;
  padding: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.monitoring-data-table tbody td {
  padding: 1rem;
  border-color: rgba(148, 163, 184, 0.22);
  vertical-align: middle;
}

.monitoring-data-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.82);
}

.monitoring-data-table tbody tr.monitoring-unified-row.is-offline {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.82), rgba(255, 255, 255, 0.98));
  box-shadow: inset 4px 0 0 #ef4444;
}

.monitoring-data-table tbody tr.monitoring-unified-row.is-attending {
  background: linear-gradient(90deg, rgba(254, 243, 199, 0.68), rgba(255, 255, 255, 0.98));
  box-shadow: inset 4px 0 0 #f59e0b;
}

.monitoring-data-table tbody tr.monitoring-unified-row.is-unstable {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.78), rgba(255, 255, 255, 0.98));
  box-shadow: inset 4px 0 0 #3b82f6;
}

.monitoring-table-primary {
  font-weight: 700;
  color: #0f172a;
}

.monitoring-table-secondary {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.84rem;
}

.monitoring-model-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.monitoring-model-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.monitoring-model-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.monitoring-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.7);
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.monitoring-mode-chip.is-mode {
  background: rgba(219, 234, 254, 0.82);
  color: #1d4ed8;
}

.monitoring-mode-chip.is-target {
  background: rgba(241, 245, 249, 0.92);
  color: #475569;
}

.monitoring-mode-chip.is-disabled {
  background: rgba(226, 232, 240, 0.96);
  color: #334155;
}

.monitoring-model-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
  flex: 0 0 auto;
}

.monitoring-model-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.28rem;
}

.monitoring-model-thumb-fallback {
  color: #475569;
  font-size: 1rem;
}

.monitoring-location-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
}

.monitoring-department-text {
  flex: 1 1 auto;
  text-align: right;
  color: #0f172a;
}

.monitoring-location-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  order: -1;
  color: #2563eb;
  text-decoration: none;
  flex: 0 0 auto;
}

.monitoring-location-button:hover {
  color: #1d4ed8;
}

.monitoring-location-button:disabled {
  color: #94a3b8;
  opacity: 0.7;
}

.monitoring-status-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem;
}

.monitoring-unified-priority-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.monitoring-unified-priority-hint.is-offline {
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
}

.monitoring-unified-priority-hint.is-attending {
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
}

.monitoring-unified-priority-hint.is-unstable {
  background: rgba(219, 234, 254, 0.95);
  color: #1d4ed8;
}

.monitoring-attention-note {
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 700;
}

.monitoring-attendance-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.73rem;
  font-weight: 700;
}

.monitoring-attendance-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-size: 0.65rem;
  font-weight: 800;
}

.monitoring-attendance-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn.monitoring-ack-button,
.monitoring-ack-button {
  min-height: 2rem;
  min-width: 2.25rem;
  padding: 0.32rem 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.94) !important;
  background: #0f172a !important;
  color: #facc15 !important;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.btn.monitoring-ack-button i,
.monitoring-ack-button i {
  color: #facc15 !important;
  flex: 0 0 auto;
  margin-right: 0.08rem;
}

.btn.monitoring-ack-button span,
.monitoring-ack-button span {
  line-height: 1;
  color: #facc15 !important;
}

.monitoring-attendance-cell {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.btn.monitoring-attendance-note-button,
.btn.overview-incident-note-button,
.monitoring-attendance-note-button,
.overview-incident-note-button {
  min-height: 1.9rem;
  min-width: 1.9rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.94) !important;
  background: #0f172a !important;
  color: #facc15 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.monitoring-attendance-note-button i,
.monitoring-attendance-note-button .fa-circle-info,
.overview-incident-note-button i,
.overview-incident-note-button .fa-circle-info {
  color: #facc15 !important;
}

.btn.monitoring-attendance-note-button:hover,
.btn.monitoring-attendance-note-button:focus,
.btn.monitoring-attendance-note-button:active,
.btn.overview-incident-note-button:hover,
.btn.overview-incident-note-button:focus,
.btn.overview-incident-note-button:active,
.monitoring-attendance-note-button:hover,
.overview-incident-note-button:hover {
  background: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.94) !important;
  color: #facc15 !important;
}

.monitoring-attendance-meta,
.overview-attendance-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.monitoring-attendance-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
}

.monitoring-attendance-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.monitoring-attendance-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.monitoring-attendance-note-text,
.overview-incident-note-text {
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.45;
  max-width: 100%;
  flex: 1 1 100%;
}

.monitoring-ack-note-modal,
.overview-ack-note-modal {
  text-align: left;
}

.monitoring-ack-note-modal strong,
.overview-ack-note-modal strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #0f172a;
}

.monitoring-ack-note-modal p,
.overview-ack-note-modal p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.btn.monitoring-ack-button.is-active,
.monitoring-ack-button.is-active {
  border-color: rgba(15, 23, 42, 0.94);
  background: #0f172a;
  color: #facc15;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.monitoring-ack-button.is-active i {
  color: #facc15 !important;
}

.btn.monitoring-ack-button.is-inline-action,
.monitoring-ack-button.is-inline-action {
  min-height: 1.9rem;
  min-width: 1.9rem;
  padding: 0.22rem 0.5rem;
  gap: 0.35rem;
}

.btn.monitoring-ack-button:hover,
.btn.monitoring-ack-button:focus,
.btn.monitoring-ack-button:active,
.monitoring-ack-button:hover {
  background: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.94) !important;
  color: #facc15 !important;
}


.server-services-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 220px;
}

.server-services-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 700;
}

.server-services-preview,
.admin-server-services-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.server-service-pill,
.admin-server-service-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1e3a8a;
  font-size: 0.76rem;
  font-weight: 600;
  max-width: 100%;
}

.server-services-button,
.admin-server-services-button {
  min-height: 2rem;
  border-radius: 999px;
  padding-inline: 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.server-services-empty {
  color: #64748b;
  font-size: 0.82rem;
}

.server-services-modal {
  text-align: left;
}

.server-services-modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.server-services-modal-header strong {
  color: #0f172a;
  font-size: 1rem;
}

.server-services-modal-header span {
  color: #64748b;
  font-size: 0.88rem;
}

.server-services-modal-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.server-services-modal-list li {
  color: #334155;
  line-height: 1.45;
}

.server-services-swal {
  border-radius: 22px !important;
}

.monitoring-gallery-modal {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
}

.monitoring-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.monitoring-gallery-item {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-surface-muted);
  min-height: 180px;
}

.monitoring-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.monitoring-gallery-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
}

#loading {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 34%),
    rgba(241, 245, 249, 0.74);
  backdrop-filter: blur(12px);
  z-index: 2000;
}

#loading .app-loading-shell {
  width: min(300px, calc(100vw - 32px));
  padding: 1.2rem 1.15rem 1.1rem;
  border-radius: 28px;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  background: var(--color-surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

#loading .app-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(148, 163, 184, 0.24);
  border-top-color: #2563eb;
  border-right-color: #0ea5e9;
  animation: app-loading-spin 0.95s linear infinite;
}

#loading .app-loading-copy {
  display: grid;
  gap: 0.12rem;
  text-align: center;
}

#loading .app-loading-copy strong {
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 700;
}

#loading .app-loading-copy span {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
}

@keyframes app-loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.container-footer {
  flex: 0 0 auto;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
}

.container-footer p {
  margin: 0;
  padding-top: 0;
  text-align: center;
}

@media (max-width: 1199px) {
  .dashboard-toolbar {
    padding-inline: 1rem;
  }

  .dashboard-toolbar h1 {
    font-size: 1.25rem;
  }

  #dash.dash-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .generic-device-summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    width: 100%;
  }

  .generic-device-filter-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .mobile-monitor-table {
    display: block;
  }

  .dash-device-card {
    display: none;
  }

  .dashboard {
    min-height: 100dvh;
    height: 100dvh;
  }

  .dashboard-app {
    margin-left: 0;
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: calc(100dvh - 60px);
  }

  .dashboard-toolbar {
    left: 0;
    right: 0;
    padding: 0.75rem;
  }

  .dashboard-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    max-width: 320px;
    height: 100dvh;
    z-index: 1070;
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.35);
  }

  .dashboard-nav.mobile-show {
    display: flex;
  }

  .dashboard-nav header {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .dashboard-nav-list {
    padding-bottom: 1rem;
  }

  .dashboard-content {
    background-size: cover;
    background-position: center center;
  }

  #dash {
    padding: 1rem;
  }

  #dash.dash-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .container-footer {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .generic-device-summary-grid,
  .generic-device-filter-grid,
  .generic-device-facts {
    grid-template-columns: 1fr;
  }

  .generic-device-toolbar-head {
    flex-direction: column;
  }

  .generic-device-card-line-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .monitoring-controls {
    grid-template-columns: 1fr;
  }

  .monitoring-summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .monitoring-control-search .form-control,
  .monitoring-control-field .form-select {
    min-height: 46px;
  }

  .monitoring-data-table {
    min-width: 0;
  }

  .monitoring-data-table thead {
    display: none;
  }

  .monitoring-data-table,
  .monitoring-data-table tbody,
  .monitoring-data-table tr,
  .monitoring-data-table td {
    display: block;
    width: 100%;
  }

  .monitoring-data-table tbody td {
    padding: 0.55rem 0.9rem;
    border: 0;
  }

  .monitoring-data-table tbody tr {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 0.75rem;
  }

  .monitoring-data-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
  }

  .monitoring-links-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  #dash .card {
    border-radius: 18px;
  }

  #dash .card-header {
    padding: 0.9rem 1rem;
  }

  #dash .card-header h5 {
    font-size: 1rem;
  }

  #dash .card-body {
    padding: 1rem;
  }

  #dash .card-body .row {
    row-gap: 0.35rem;
  }

  #dash .card-body .form-label {
    margin-bottom: 0.35rem;
  }

  #dash .card-body .form-control,
  #dash .card-body .form-select {
    min-height: 46px;
    border-radius: 12px;
  }

  #dash .card-body .btn {
    min-height: 44px;
  }

  #dash .card-body .d-flex.justify-content-end,
  #dash .card-body .d-flex.gap-2.justify-content-end {
    flex-direction: column;
    align-items: stretch;
  }

  #dash .card-body .d-flex.justify-content-end .btn,
  #dash .card-body .d-flex.gap-2.justify-content-end .btn {
    width: 100%;
  }

  #dash .card-body .border.rounded-3.bg-light {
    min-height: 96px !important;
  }

  .admin-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-card-grid-split {
    grid-template-columns: 1fr;
  }

  .admin-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .location-admin-list {
    grid-template-columns: 1fr;
  }

  .admin-entity-header {
    grid-template-columns: auto 1fr;
  }

  .admin-entity-header > .admin-entity-logo:last-child,
  .admin-entity-header > .admin-entity-badge:last-child {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .admin-entity-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .admin-entity-actions {
    grid-template-columns: 1fr;
  }

  .admin-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .admin-info-value {
    text-align: left;
  }

  .admin-entity-card {
    border-radius: 16px;
  }

  .admin-entity-body {
    padding: 1rem;
  }

  .admin-entity-copy h3 {
    font-size: 1rem;
  }

  .admin-entity-copy p {
    font-size: 0.84rem;
  }

  .admin-server-services {
    padding: 0.85rem 0.9rem;
  }

  .admin-server-services-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-server-services-button {
    width: 100%;
    justify-content: center;
  }

  .server-services-cell {
    min-width: 0;
    width: 100%;
  }

  .server-services-button {
    width: 100%;
    justify-content: center;
  }

  .monitoring-model-cell {
    width: 100%;
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .monitoring-model-thumb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .server-services-preview,
  .admin-server-services-preview {
    gap: 0.3rem;
  }

  .server-service-pill,
  .admin-server-service-pill {
    min-height: 1.7rem;
    font-size: 0.72rem;
  }

  .mobile-monitor-table {
    border-radius: 14px;
  }

  .mobile-monitor-head,
  .mobile-monitor-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(88px, 0.95fr) minmax(96px, 0.9fr);
  }

  .mobile-monitor-head-cell,
  .mobile-monitor-cell {
    padding: 0.8rem 0.75rem;
  }

  .mobile-monitor-head {
    font-size: 0.72rem;
  }

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card-profile {
    width: 100%;
  }

  .mobile-monitor-value {
    font-size: 0.9rem;
  }

  .mobile-monitor-meta {
    font-size: 0.76rem;
  }

  .dashboard-toolbar {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .dashboard-toolbar h1 {
    font-size: 1rem;
  }

  #dashboard-button {
    padding: 0.4rem 0.55rem;
  }

  #dashboard-button span {
    display: none;
  }

  .avatar {
    width: 30px;
    height: 30px;
    margin-right: 0;
  }

  .dashboard-content {
    background-image: var(--custom-home-panel-bg-image, none);
    background-size: cover;
    background-position: center center;
  }

  #dash {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  #dash.dash-layout-grid {
    grid-template-columns: 1fr;
  }

  .dash-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    position: sticky;
    top: 0;
  }

  .dash-toolbar-actions .btn {
    width: 100%;
  }

  .dash-device-card {
    border-radius: 14px;
  }

  .dash-device-card .card-header {
    min-height: 56px;
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .dash-device-media {
    display: none;
  }

  .dash-device-card .list-group-item,
  .list-group-item {
    padding: 0.8rem 0.9rem;
    font-size: 0.92rem;
  }

  .status-chip {
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .container-footer {
    gap: 0.5rem;
    padding-block: 0.65rem;
  }

  .container-footer img {
    height: 20px;
  }

  .container-footer p {
    width: 100%;
    font-size: 0.7rem;
  }
}

@media (max-width: 479.98px) {
  .mobile-monitor-head {
    display: none;
  }

  .mobile-monitor-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.2rem 0;
  }

  .mobile-monitor-cell {
    padding: 0.15rem 0.85rem;
  }

  .mobile-monitor-cell::before {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
  }

  .mobile-monitor-cell-label::before {
    content: 'Loja';
  }

  .mobile-monitor-cell-ip::before {
    content: 'IP';
  }

  .mobile-monitor-cell-status::before {
    content: 'Status';
  }

  .mobile-monitor-cell-status {
    padding-bottom: 0.75rem;
  }

  .dashboard-nav {
    width: 100%;
    max-width: none;
  }

  .dashboard-nav-item,
  .dashboard-nav-dropdown-item {
    padding-left: 64px;
    padding-right: 16px;
  }

  .dashboard-nav-dropdown-menu {
    padding-block: 0.2rem;
  }

  .dashboard-nav-dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .dashboard-nav-item i {
    margin-left: -34px;
  }

  .dashboard-toolbar {
    grid-template-columns: auto 1fr auto;
  }

  .dashboard-toolbar h1 {
    font-size: 0.95rem;
  }

  #dash {
    padding: 0.65rem;
  }

  .settings-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .settings-card-header {
    flex-direction: column;
  }

  .settings-card-icon {
    width: 3rem;
    height: 3rem;
  }

  .profile-settings-avatar-image {
    width: 92px;
    height: 92px;
  }

  .profile-settings-avatar-overlay {
    opacity: 1;
    font-size: 0.74rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.72));
    justify-content: flex-end;
    padding-bottom: 0.75rem;
  }

  #location-search,
  #catalog-search {
    max-width: none !important;
  }

  .location-admin-card,
  .catalog-admin-item > div {
    border-radius: 16px !important;
    padding: 1rem !important;
  }

  .location-admin-card .d-flex.gap-2,
  .catalog-admin-item .d-flex.gap-2 {
    flex-direction: column;
  }

  .location-admin-card .btn,
  .catalog-admin-item .btn {
    width: 100%;
    min-height: 42px;
  }

  #catalog-form .form-check {
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  #catalog-form .d-flex.flex-wrap.gap-3 {
    gap: 0.85rem !important;
    flex-direction: column;
    align-items: flex-start;
  }

  .swal2-popup {
    width: calc(100vw - 24px) !important;
    border-radius: 18px !important;
  }

  .swal2-select,
  .swal2-input,
  .swal2-file {
    width: 100% !important;
    margin-inline: 0 !important;
  }

  .swal2-actions {
    width: 100%;
    flex-direction: column-reverse;
  }

  .swal2-actions button {
    width: 100%;
    margin: 0 !important;
  }

  .overview-hero {
    padding: 1rem;
    border-radius: 18px;
  }

  .overview-hero h2 {
    font-size: 1.45rem;
  }

  .overview-fullscreen-btn {
    width: 100%;
    justify-content: center;
  }

  .overview-refresh-meta {
    width: 100%;
    min-width: 0;
  }
}

.admin-page-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.admin-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.admin-summary-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 96px;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.admin-summary-icon {
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 2.9rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 1rem;
}

.admin-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.admin-summary-copy span {
  color: #64748b;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-summary-copy strong {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
}

.admin-summary-copy small {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.admin-summary-card.is-primary .admin-summary-icon {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.admin-summary-card.is-warning .admin-summary-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.admin-summary-card.is-success .admin-summary-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.catalog-admin-shell {
  --catalog-panel-radius: 22px;
  --catalog-panel-border: rgba(148, 163, 184, 0.22);
  --catalog-panel-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.catalog-admin-shell .catalog-admin-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.catalog-admin-shell .catalog-admin-grid > .admin-summary-strip,
.catalog-admin-shell .catalog-admin-grid > .admin-card {
  grid-column: 1 / -1;
  width: 100%;
}

.catalog-admin-panel {
  border: 1px solid var(--catalog-panel-border) !important;
  border-radius: var(--catalog-panel-radius) !important;
  overflow: hidden;
  box-shadow: var(--catalog-panel-shadow) !important;
}

.catalog-admin-panel-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 1.15rem 1.35rem !important;
}

.catalog-admin-panel-head h5 {
  letter-spacing: -0.02em;
}

.catalog-admin-panel-head p {
  max-width: 62ch;
}

.catalog-admin-panel-head-light {
  background: linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted)) !important;
  border-bottom-color: var(--color-border) !important;
}

.catalog-admin-panel-body {
  padding: 1.35rem !important;
}

.catalog-admin-form .form-label {
  font-weight: 700;
  color: var(--color-text);
}

.catalog-admin-form .form-control,
.catalog-admin-form .form-select {
  min-height: 48px;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: none;
}

.catalog-admin-form .form-control:focus,
.catalog-admin-form .form-select:focus,
#catalog-search:focus,
#catalog-scope-filter:focus,
#catalog-brand-filter:focus {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.catalog-type-tab {
  min-height: 42px;
  border-radius: 999px !important;
  padding-inline: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.catalog-admin-panel-form .catalog-type-tab.btn-light {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

#catalog-search,
#catalog-scope-filter,
#catalog-brand-filter {
  min-height: 46px;
  border-radius: 14px;
}

#catalog-empty-state {
  border-radius: 16px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted)) !important;
}

.catalog-admin-item > div {
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted)) !important;
  box-shadow: var(--shadow-lg) !important;
}

.catalog-admin-item .card-title,
.catalog-admin-item h5,
.catalog-admin-item h6,
.catalog-admin-item strong {
  color: var(--color-text);
}

.catalog-admin-item .text-muted {
  color: var(--color-text-soft) !important;
}

.catalog-admin-item .btn-warning {
  border: 0;
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  color: #1f2937 !important;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.22);
}

.catalog-admin-item .btn-warning:hover {
  filter: brightness(1.03);
}

.catalog-admin-item .btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.42) !important;
  color: #dc2626 !important;
  background: var(--color-surface) !important;
}

.catalog-admin-item .btn-outline-danger:hover {
  background: rgba(254, 226, 226, 0.9) !important;
}

.catalog-admin-panel .upload-preview-grid {
  min-height: 124px;
  align-items: stretch;
}

.catalog-admin-panel .upload-preview-card,
.catalog-admin-panel .upload-preview-empty {
  border-radius: 16px;
}

/* Legacy alias do .ds-page-hero--accent — usa tokens, adapta a dark mode automaticamente.
   Migrar uso novo para .ds-page-hero.ds-page-hero--accent. */
.admin-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.10), transparent 52%),
    linear-gradient(135deg, var(--nz-blue-800), var(--nz-blue-700) 55%, var(--nz-blue-600));
  color: var(--color-hero-accent-text);
  box-shadow: 0 16px 38px rgba(15, 49, 148, 0.28);
}

.admin-page-hero h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.admin-page-hero p {
  margin: 0.35rem 0 0;
  color: var(--color-hero-accent-text-soft);
  max-width: 720px;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.admin-card-grid-split {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

/* Grupos empresariais: form de criacao em faixa no topo + grade de grupos (2026-06-22) */
.admin-create-card,
.company-group-create-card {
  padding: 1.1rem 1.4rem 1.25rem;
}
.admin-create-header,
.company-group-create-header {
  margin-bottom: 0.85rem;
}
.admin-create-form,
.company-group-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.admin-create-field,
.company-group-create-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.admin-create-field--name,
.company-group-create-field--name { flex: 1 1 260px; }
.admin-create-field--logo,
.company-group-create-field--logo { flex: 1 1 300px; }
.admin-create-field--group { flex: 1 1 340px; }
.admin-create-field--submit,
.company-group-create-field--submit { flex: 0 0 auto; }
.admin-create-field--submit .ds-button,
.company-group-create-field--submit .ds-button { white-space: nowrap; }

/* Empresa: select de grupo + botao "Novo grupo" lado a lado dentro do campo */
.location-group-control {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.location-group-control .ds-select { flex: 1 1 auto; min-width: 0; }
.location-group-control .ds-button { flex: 0 0 auto; white-space: nowrap; }

.ds-file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.45rem 0.6rem;
  border: 1px dashed rgba(31, 94, 255, 0.35);
  border-radius: 14px;
  background: rgba(31, 94, 255, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.ds-file-picker:hover {
  border-color: rgba(31, 94, 255, 0.6);
  background: rgba(31, 94, 255, 0.07);
}
.ds-file-picker__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ds-file-picker__thumb {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 2.4rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-muted);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--nz-blue-600);
  overflow: hidden;
}
.ds-file-picker__thumb img { width: 100%; height: 100%; object-fit: contain; }
.ds-file-picker__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.ds-file-picker__text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-file-picker__text small { font-size: 0.72rem; color: var(--color-text-muted, #64748b); }
.ds-file-picker__cta {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-text);
}

.admin-toolbar.company-group-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
}
.admin-entity-grid,
.company-group-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.admin-entity-grid > div,
.company-group-admin-grid > div { display: flex; min-width: 0; }
.admin-entity-grid > div > .admin-entity-card,
.company-group-admin-grid > div > .admin-entity-card { width: 100%; }

.admin-card {
  min-width: 0;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 1.4rem;
}

.admin-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.admin-card-header h3 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.admin-card-header p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.admin-form .form-label {
  font-weight: 700;
  color: var(--color-text);
}

.admin-form .form-control,
.admin-form .form-select,
.admin-toolbar .form-control,
.admin-toolbar .form-select {
  min-height: 48px;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: none;
}

.admin-form .form-control:focus,
.admin-form .form-select:focus,
.admin-toolbar .form-control:focus,
.admin-toolbar .form-select:focus {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.location-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.location-admin-item {
  min-width: 0;
}

#generic-device-list.admin-card-grid {
  justify-items: start;
}

#generic-device-list .generic-device-admin-item {
  width: min(100%, 380px);
}

/* As LINHAS da lista de Equipamentos (gestao) reusam .generic-device-admin-item
   (necessario p/ o filtro show/hide do applyGenericDeviceFilter), mas NAO devem
   herdar o cap de 380px dos CARDS acima. Precisa ficar AQUI (mesma @layer overrides
   que o cap) — um override em layout.css (@layer pages) perde pro cap independente
   de especificidade. Especificidade de ID maior (1-2-0 > 1-1-0) vence dentro da layer. */
.device-monitor-page #generic-device-list .device-asset-row {
  width: 100%;
}

.admin-entity-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.admin-entity-topbar {
  height: 6px;
}

.admin-tone-primary .admin-entity-topbar { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.admin-tone-info .admin-entity-topbar { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.admin-tone-success .admin-entity-topbar { background: linear-gradient(90deg, #0f766e, #34d399); }
.admin-tone-warning .admin-entity-topbar { background: linear-gradient(90deg, #ca8a04, #facc15); }
.admin-tone-danger .admin-entity-topbar { background: linear-gradient(90deg, #dc2626, #fb7185); }
.admin-tone-dark .admin-entity-topbar { background: linear-gradient(90deg, #111827, #475569); }
.admin-tone-secondary .admin-entity-topbar { background: linear-gradient(90deg, #475569, #94a3b8); }
.admin-tone-unstable .admin-entity-topbar { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.admin-entity-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
  flex: 1 1 auto;
}

.admin-entity-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
}

.admin-entity-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 1.1rem;
}

.admin-entity-logo {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.admin-entity-logo.is-empty {
  color: var(--color-text-muted);
}

.admin-entity-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-entity-header > .admin-entity-logo:last-child {
  justify-self: end;
}

.admin-entity-copy h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--color-text);
}

.admin-entity-copy p {
  margin: 0.18rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.generic-device-admin-item .admin-entity-header {
  align-items: start;
}

.generic-device-admin-item .admin-entity-copy {
  min-width: 0;
}

.generic-device-admin-item .admin-entity-copy h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generic-device-admin-item .admin-entity-copy p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-type-icon-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 0.92rem;
}

.device-type-icon-preview i {
  font-size: 1rem;
}

.device-type-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  text-align: left;
}

.device-type-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 96px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.device-type-icon-option:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-lg);
}

.device-type-icon-option i {
  font-size: 1.3rem;
}

.device-type-icon-option span {
  font-size: 0.82rem;
  font-weight: 600;
}

.generic-device-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

.generic-device-card-line {
  min-width: 0;
}

.generic-device-card-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.generic-device-card-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.generic-device-card-headings {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.generic-device-card-name {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
  line-height: 1.3;
}

.generic-device-card-location {
  margin: 0;
  color: #64748b;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generic-device-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.generic-device-chip,
.generic-device-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.generic-device-state-pill {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.generic-device-state-pill.is-success {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.generic-device-state-pill.is-danger {
  background: rgba(251, 113, 133, 0.14);
  color: #be123c;
  animation: heartbeat 0.8s infinite;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.12);
}

.generic-device-state-pill.is-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.generic-device-state-pill.is-unstable {
  background: rgba(139, 92, 246, 0.16);
  color: #7c3aed;
}

.generic-device-state-pill.is-muted {
  background: rgba(71, 85, 105, 0.14);
  color: #475569;
}

.generic-device-chip {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.generic-device-chip.is-mode {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.generic-device-chip.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.generic-device-chip.is-muted {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.generic-device-chip.is-target {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.generic-device-chip.is-context.is-danger {
  background: rgba(251, 113, 133, 0.14);
  color: #be123c;
}

.generic-device-chip.is-context.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.generic-device-chip.is-context.is-unstable {
  background: rgba(139, 92, 246, 0.14);
  color: #7c3aed;
}

.generic-device-chip.is-context.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.generic-device-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.generic-device-fact {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.72rem 0.82rem;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.generic-device-fact span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.generic-device-fact strong {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.generic-device-page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.generic-device-page-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 780px;
}

.generic-device-page-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.generic-device-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0.75rem;
  width: min(100%, 760px);
}

.generic-device-summary-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 86px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.generic-device-summary-card.is-neutral { background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(241,245,249,0.88)); }
.generic-device-summary-card.is-success { background: linear-gradient(135deg, rgba(236,253,245,0.98), rgba(220,252,231,0.92)); }
.generic-device-summary-card.is-danger { background: linear-gradient(135deg, rgba(255,241,242,0.98), rgba(255,228,230,0.92)); }
.generic-device-summary-card.is-muted { background: linear-gradient(135deg, rgba(248,250,252,0.96), rgba(226,232,240,0.92)); }

.generic-device-summary-icon {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 1rem;
}

.generic-device-summary-card.is-success .generic-device-summary-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.generic-device-summary-card.is-danger .generic-device-summary-icon {
  background: rgba(244, 63, 94, 0.14);
  color: #be123c;
}

.generic-device-summary-card.is-muted .generic-device-summary-icon {
  background: rgba(71, 85, 105, 0.14);
  color: #475569;
}

.generic-device-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.generic-device-summary-copy span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.generic-device-summary-copy strong {
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.generic-device-summary-copy small {
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
}

.generic-device-toolbar-shell {
  border-radius: 20px;
  padding: 1rem 1.1rem 1.1rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.generic-device-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.generic-device-toolbar-head h5 {
  margin: 0;
  color: #0f172a;
  font-size: 1.04rem;
}

.generic-device-toolbar-head p {
  margin: 0.28rem 0 0;
  color: #64748b;
  max-width: 720px;
}

.generic-device-toolbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.generic-device-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(180px, 0.7fr));
  gap: 0.85rem;
}

.generic-device-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.generic-device-filter-field span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.generic-device-filter-field .form-control,
.generic-device-filter-field .form-select {
  min-height: 46px;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.26);
}

.generic-device-grid {
  align-items: start;
}

.generic-device-empty-state {
  border-radius: 18px;
}

.admin-entity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-entity-badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-entity-badge.is-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.admin-entity-badge.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.admin-entity-badge.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.admin-entity-badge.is-muted {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.admin-entity-details {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.admin-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.admin-info-label {
  color: #64748b;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-info-value {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.admin-entity-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0 1.1rem 1.1rem;
}

.admin-entity-actions .btn {
  min-height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.admin-empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  color: #334155;
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.admin-user-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(226, 232, 240, 0.9);
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.4rem;
}

.monitoring-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  grid-column: 1 / -1;
}

.admin-server-services {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.admin-server-services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-server-services-title {
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-server-services-count {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-server-services-empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.mobile-monitor-table {
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
}

.mobile-monitor-head {
  position: sticky;
  top: 0;
  z-index: 1;
}

.mobile-monitor-row:hover {
  background: rgba(224, 231, 255, 0.32);
}

/* Hover claro (indigo) sem guarda → clarão no escuro. Tinte escuro sutil. */
:root[data-theme-mode="dark"] .mobile-monitor-row:hover {
  background: var(--color-surface-muted);
}

.monitoring-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.settings-shell {
  min-height: 100%;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.settings-card {
  width: min(100%, 520px);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted));
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: 1.4rem;
}

.settings-card-profile {
  width: min(100%, 620px);
}

.settings-card-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 1.25rem;
}

.settings-card-header h2 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--color-text);
}

.settings-card-header p {
  margin: 0.35rem 0 0;
  color: var(--color-text-soft);
  line-height: 1.5;
}

.profile-settings-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.profile-settings-avatar-label {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-settings-avatar-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.profile-settings-avatar-image {
  width: 100px;
  height: 100px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.profile-settings-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.52);
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.18s ease;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-settings-avatar-label:hover .profile-settings-avatar-overlay,
.profile-settings-avatar-label:focus-visible .profile-settings-avatar-overlay {
  opacity: 1;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-field-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.profile-field-block-full {
  grid-column: 1 / -1;
}

.settings-card-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e, #34d399);
  color: #ffffff;
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-link-button {
  background: transparent;
  border: 0;
  color: #2563eb;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0;
  margin-top: 0.75rem;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.login-link-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.login-reset-shell {
  width: min(100%, 560px);
  margin: 0 auto;
}

.body-login {
  min-height: 100vh;
  background-color: var(--custom-login-bg-color, #f4f6f8);
  background-image: var(--custom-login-bg-image, none);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  color: #0f172a;
}

.area-login {
  min-height: 100vh;
  padding: 24px 20px;
  display: grid;
  justify-items: center;
  align-items: safe center;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.1), transparent 26%),
    rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.login-shell {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 460px);
  border-radius: 32px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.login-showcase {
  position: relative;
  padding: 2.4rem clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.2), transparent 34%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.92));
  color: #f8fafc;
}

.login-showcase::after {
  content: '';
  position: absolute;
  inset: auto 2.2rem 2rem auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0));
  pointer-events: none;
}

.login-showcase-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-showcase-body {
  display: grid;
  gap: 1rem;
  max-width: 560px;
}

.login-showcase-overline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(191, 219, 254, 0.78);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-showcase-overline::before {
  content: '';
  width: 28px;
  height: 1px;
  background: rgba(191, 219, 254, 0.55);
}

.login-showcase-title {
  margin: 0;
  font-size: clamp(1.85rem, 2.9vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.login-showcase-copy {
  margin: 0;
  max-width: 460px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 1.02rem;
  line-height: 1.72;
}

.login-showcase-footer {
  display: grid;
  gap: 1rem;
}

.login-showcase-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.login-metric {
  padding: 0.8rem 0.95rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-metric strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.login-metric span {
  display: block;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.82rem;
  line-height: 1.42;
}

.login-showcase-note {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(226, 232, 240, 0.74);
  font-size: 0.88rem;
}

.login-showcase-note-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
}

.login-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
}

.login-panel-topbar {
  padding: 1.4rem 1.55rem 0;
}

.login-panel-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: auto;
  height: auto;
  padding: 2.2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: stretch;
  background: transparent;
  border-radius: 0;
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.1rem;
  padding-bottom: 0.55rem;
  min-height: 108px;
}

.login-brand img,
.login img {
  width: auto;
  max-width: 360px;
  max-height: 124px;
  object-fit: contain;
}

.login-copy {
  margin-top: 1rem;
}

.login-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2.2vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.login-copy p {
  margin: 0.7rem 0 0;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.6;
}

.login-form,
.login form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: 1.65rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.login-field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.login input,
.register input {
  margin-top: 0;
  height: 52px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  color: #0f172a;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 20px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login input:focus,
.register input:focus {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 14px 28px rgba(37, 99, 235, 0.08);
  background: #ffffff;
}

.login input::placeholder,
.register input::placeholder {
  color: #94a3b8;
}

.login .btnclass {
  margin-top: 0.35rem;
  height: 52px;
  border: 1px solid rgba(37, 99, 235, 0.92);
  border-radius: 16px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0ea5e9 100%);
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease,
    border-color 0.18s ease;
}

.login .btnclass:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  border-color: rgba(59, 130, 246, 0.98);
  box-shadow:
    0 22px 38px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.login .btnclass:focus-visible {
  outline: 0;
  border-color: rgba(147, 197, 253, 0.98);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.18),
    0 18px 34px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#message {
  width: 100%;
  min-height: 1.25rem;
  margin-top: 1rem;
  color: #dc2626;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}

.login-panel-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  margin-top: 1rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  text-align: center;
}

.login-panel-foot-copy {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  text-align: center;
  width: 100%;
}

.login-link-button {
  align-self: center;
  color: #2563eb;
}

/* Localizador de espaço — variante do /login no apex (netzor.com.br). */
.login-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-workspace-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.login-workspace-copy {
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.55;
}

.login-workspace-form {
  margin-top: 1.35rem;
}

.login-workspace-field {
  display: flex;
  align-items: stretch;
}

.login-workspace-field .ds-field {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.login-workspace-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.login-workspace-error {
  margin: 0.15rem 0 0;
  color: #b91c1c;
  font-size: 0.86rem;
  line-height: 1.45;
}

.login-platform-admin {
  margin-top: 1.15rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.login-platform-admin summary {
  cursor: pointer;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  list-style: none;
}

.login-platform-admin summary::-webkit-details-marker {
  display: none;
}

.login-platform-admin summary:hover {
  color: #2563eb;
}

.login-platform-admin[open] summary {
  color: #2563eb;
  margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  /* O painel de apresentacao some no celular e no tablet.

     Ele existe para ocupar a segunda coluna do .login-shell. Abaixo de
     991.98px o grid vira coluna unica (regra acima) e o painel passa a
     empilhar ACIMA do formulario: medido em 375px, 1203px de altura numa
     viewport de 812px, ou seja, era preciso rolar quase mil e duzentos
     pixels de texto institucional antes de chegar no campo de e-mail.
     Sem a segunda coluna o painel perde a funcao e vira obstaculo.

     As regras de .login-showcase-* logo abaixo ficam inertes enquanto
     isto valer; foram mantidas de proposito para que reexibir o painel
     seja so remover este display. */
  .login-showcase {
    display: none;
  }

  .login-showcase {
    padding: 2rem 1.4rem 1.6rem;
    gap: 1.5rem;
  }

  .login-showcase-title {
    font-size: clamp(1.9rem, 7vw, 3rem);
  }

  .login-showcase-metrics {
    grid-template-columns: 1fr;
  }

  .login {
    padding: 1.5rem 1.35rem 1.75rem;
  }

  .login-brand {
    min-height: 98px;
    padding-top: 0;
    padding-bottom: 0.45rem;
  }

  .login-brand img,
  .login img {
    max-width: 300px;
    max-height: 104px;
  }
}

@media (max-height: 820px) {
  .area-login {
    padding: 16px;
  }

  .login-shell {
    min-height: auto;
  }

  .login-showcase {
    padding: 2.2rem 2rem 2rem;
    gap: 1.4rem;
  }

  .login-showcase-title {
    font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  }

  .login-showcase-metrics {
    gap: 0.75rem;
  }

  .login-metric {
    padding: 0.85rem 0.9rem;
  }

  .login {
    padding: 1.6rem 1.6rem 1.8rem;
  }

  .login-brand {
    min-height: 102px;
  }

  .login-brand img,
  .login img {
    max-width: 320px;
    max-height: 108px;
  }
}

@media (max-height: 900px) and (max-width: 1440px) {
  .login-shell {
    min-height: auto;
    max-height: calc(100vh - 32px);
  }

  .login-showcase {
    padding: 2.2rem 2rem;
    gap: 1.25rem;
  }

  .login-showcase-title {
    font-size: clamp(1.6rem, 3vw, 2.7rem);
  }

  .login-showcase-copy {
    font-size: 0.96rem;
  }

  .login-showcase-metrics {
    gap: 0.7rem;
  }

  .login-metric {
    padding: 0.8rem 0.85rem;
  }

  .login-metric strong {
    font-size: 0.86rem;
  }

  .login-metric span {
    font-size: 0.78rem;
  }

  .login {
    padding: 1.6rem 1.6rem 1.7rem;
  }

  .login-brand img,
  .login img {
    max-height: 82px;
  }

  .login input,
  .register input {
    height: 48px;
  }

  .login .btnclass {
    height: 48px;
  }
}

@media (max-width: 1366px) and (max-height: 768px) {
  .area-login {
    padding: 10px;
    min-height: 100vh;
    height: auto;
  }

  .login-shell {
    min-height: auto;
    max-height: none;
    height: auto;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  }

  .login-showcase {
    padding: 1.35rem 1.45rem 1.2rem;
    gap: 1rem;
    justify-content: space-evenly;
  }

  .login-showcase-body {
    max-width: 480px;
    gap: 0.85rem;
  }

  .login-showcase-title {
    font-size: clamp(1.22rem, 2.2vw, 1.95rem);
    line-height: 1.02;
  }

  .login-showcase-copy {
    font-size: 0.82rem;
    line-height: 1.38;
  }

  .login-showcase-footer {
    gap: 0.8rem;
  }

  .login-showcase-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .login-metric {
    padding: 0.5rem 0.62rem;
    border-radius: 14px;
  }

  .login-metric strong {
    font-size: 0.76rem;
    margin-bottom: 0.16rem;
  }

  .login-metric span {
    font-size: 0.68rem;
    line-height: 1.28;
  }

  .login-showcase-note {
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-top: 0.2rem;
  }

  .login-showcase-note-dot {
    width: 9px;
    height: 9px;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
  }

  .login {
    padding: 1.2rem 1.25rem 1.3rem;
    justify-content: space-evenly;
  }

  .login-brand img,
  .login img {
    max-height: 58px;
  }

  .login input,
  .register input {
    height: 42px;
  }

  .login .btnclass {
    height: 42px;
  }

  .login-panel-foot {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
  }

  .body-login {
    overflow: auto;
  }

  .login-form,
  .login form {
    margin-top: 0.9rem;
    gap: 0.72rem;
  }

  .login-panel-foot {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  #dash {
    padding: 0.75rem;
  }

  .inventory-summary-strip {
    gap: 0.6rem;
  }

  .inventory-summary-card {
    padding: 0.7rem 0.8rem;
    min-height: 72px;
  }

  .inventory-filter-strip,
  .helpdesk-filter-grid {
    gap: 0.6rem;
  }

  .inventory-filter-strip .inventory-filter-input,
  .inventory-filter-strip .inventory-filter-select,
  .helpdesk-filter-grid .inventory-filter-input,
  .helpdesk-filter-grid .inventory-filter-select {
    min-height: 40px;
  }

  .helpdesk-workspace-board {
    gap: 0.6rem;
  }

  .helpdesk-workspace-board .helpdesk-board {
    gap: 0.5rem;
  }

  .helpdesk-column {
    padding: 0.6rem;
  }

  .helpdesk-column-head h3 {
    font-size: 0.86rem;
  }

  .helpdesk-ticket-card {
    padding: 0.6rem 0.65rem;
  }

  .helpdesk-ticket-head h4 {
    font-size: 0.9rem;
  }

  .helpdesk-ticket-stack span,
  .helpdesk-ticket-origin {
    font-size: 0.74rem;
  }

  .monitoring-summary-card {
    padding: 0.7rem 0.8rem;
  }

  .monitoring-summary-copy strong {
    font-size: 1.1rem;
  }

  .monitoring-controls {
    gap: 0.6rem;
  }

  .monitoring-control-search .form-control,
  .monitoring-control-field .form-select {
    min-height: 40px;
  }

  .monitoring-data-table thead th,
  .monitoring-data-table tbody td {
    padding: 0.65rem;
  }
}

@media (max-width: 1366px) and (max-height: 768px) {
  .dashboard-nav {
    width: 210px;
  }

  .dashboard-brand-toggle {
    font-size: 0.74rem;
  }

  .dashboard-store-toggle,
  #vpn .dashboard-nav-item,
  #usCall .dashboard-nav-item,
  #admin-nav {
    font-size: 0.76rem;
  }

  .dashboard-nav-dropdown-item {
    min-height: 2.15rem;
    font-size: 0.82rem;
  }

  .dashboard-toolbar {
    gap: 0.5rem;
  }

  .dashboard-toolbar h1 {
    font-size: clamp(0.92rem, 1.2vw, 1.05rem);
    letter-spacing: 0.08em;
  }

  #dash {
    padding: 0.85rem;
  }

  .admin-card-grid {
    gap: 1rem;
  }

  .admin-summary-strip {
    gap: 0.6rem;
  }

  .admin-summary-card {
    padding: 0.75rem 0.85rem;
  }

  .monitoring-summary-card {
    padding: 0.75rem 0.85rem;
  }

  .monitoring-controls {
    gap: 0.7rem;
  }

  .monitoring-data-table thead th,
  .monitoring-data-table tbody td {
    padding: 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .area-login {
    padding: 14px;
  }

  .login-shell {
    border-radius: 24px;
  }

  .login-panel-topbar {
    padding: 1rem 1rem 0;
  }

  .login-copy h2 {
    font-size: 1.65rem;
  }

  .login-panel-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-panel-foot-copy {
    text-align: left;
  }
}

/* Mobile: o shell empilha em 1 coluna e o conteudo (painel + form) excede a
   altura da tela. Duas coisas quebravam o acesso ao formulario:
   1) a trava de altura das telas landscape pequenas
      (@media max-height:900 and max-width:1440) tambem casa aqui e cortava o
      shell com overflow:hidden, escondendo o form abaixo do painel;
   2) o <body> do app SPA trava o scroll da pagina (shell fixo), entao nem
      rolando dava pra alcancar o form.
   Solucao: liberar a altura do shell E transformar a .area-login no proprio
   container de scroll (altura da tela + overflow-y:auto), alinhando o card no
   topo. Assim o usuario rola dentro da area ate o form, sem depender de
   destravar o body global. Registrada por ULTIMO no bloco de login para vencer
   a media query de altura acima. dvh (com fallback vh) evita corte pelas
   barras dinamicas do browser mobile.
   3) grid-template-columns:1fr forca 1 coluna: aquela media query landscape
      (max-height:768) reestabelece 2 colunas (minmax 320-420px), o que em
      celular PORTRAIT de altura <768px (comum com as barras do browser)
      espremia o painel lateral para ~40px e cortava o texto. No mobile o layout
      DEVE empilhar. */
@media (max-width: 991.98px) {
  .area-login {
    align-items: start;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
    max-height: none;
    height: auto;
    overflow: visible;
  }
}

/* ============================================================
   LOGIN EM TELA ESTREITA — layout de tela cheia

   Com o painel de apresentacao oculto, sobrava so o cartao do
   formulario flutuando no meio da tela: margem dos dois lados, cantos
   arredondados, sombra e um vazio grande embaixo. Num aparelho isso le
   como conteudo perdido no meio da pagina, nao como a tela de entrada
   do sistema.

   O .area-login e grid com justify-content: center, entao o
   `width: min(1180px, 100%)` do shell resolvia contra a TRILHA (que
   encolhe ao conteudo) e nao contra a viewport -- por isso o cartao
   ficava estreito. Dai o justify-items/align-items abaixo.

   Celular (<=640px): o cartao vira a propria tela. Sem margem, sem raio,
   sem sombra, ocupando 100dvh (dvh e nao vh por causa da barra do
   Safari, que muda de altura ao rolar). O conteudo fica centralizado
   na vertical.

   Tablet (641-991.98px): cartao continua cartao, mas com largura
   propria e centralizado -- esticar um formulario de login por 900px
   ficaria pior que o problema original.
   ============================================================ */
@media (max-width: 991.98px) {
  /* justify-content: center faz a TRILHA do grid encolher ao conteudo, e
     ai o `width: min(1180px, 100%)` do shell resolve contra ela em vez da
     viewport -- era isso que deixava o cartao estreito no meio da tela.
     Uma trilha 1fr explicita resolve na origem. */
  .area-login {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: stretch;
  }

  .login-shell {
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 991.98px) {
  .area-login {
    justify-items: center;
    align-items: center;
  }

  .login-shell {
    width: min(480px, 100%);
  }
}

@media (max-width: 640px) {
  .area-login {
    padding: 0;
    align-items: stretch;
    height: 100dvh;
    max-height: none;
  }

  .login-shell {
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .login-panel {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* space-evenly espalhava os blocos e criava buracos; no celular o
     conjunto logo + campos fica centrado como um bloco so.

     max-width: a casca ocupa a tela inteira, mas o formulario nao deve
     acompanhar: em 640px os campos passariam de 590px de largura, o que
     nao le como tela de login. A coluna para em 420px e fica centrada;
     em telas estreitas o padding manda antes disso e nada muda.

     env(safe-area-inset-bottom) protege o rodape da barra de gestos do
     iPhone. */
  .login {
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    padding: 1.75rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .login-brand {
    min-height: 0;
    padding-bottom: 1.75rem;
  }
}

.device-type-icon-picker-note {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.import-hint-box {
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  color: #334155;
}

.import-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.import-stepper-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.import-stepper-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.import-stepper-item div:last-child {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
}

.import-stepper-item.is-active {
  background: linear-gradient(180deg, #ecfeff, #f8fafc);
  border-color: rgba(14, 165, 233, 0.22);
}

.import-stepper-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.import-guide-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 1rem 1.05rem;
  color: #334155;
}

.import-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.import-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.import-guide-item {
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.85rem 0.9rem;
}

.import-guide-item strong {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 0.2rem;
}

.import-guide-item span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #64748b;
}

.import-guide-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.import-guide-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.import-guide-badge.is-essential {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

.import-guide-badge.is-optional {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.import-guide-badge.is-extra {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.import-empty-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 1rem 1.05rem;
  color: #334155;
}

.import-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  flex: 0 0 auto;
}

.import-columns-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.45rem 0.85rem;
  align-items: start;
  color: #334155;
}

.import-preview-table thead th {
  text-align: center;
}

@media (max-width: 767.98px) {
  .import-stepper,
  .import-guide-grid {
    grid-template-columns: 1fr;
  }

  .import-columns-grid {
    grid-template-columns: 1fr;
  }
}

.monitoring-agent-detail-explainer,
.monitoring-agent-batch-panel {
  margin-top: 1rem;
}

.monitoring-agent-batch-table {
  display: grid;
  gap: 0.45rem;
}

.monitoring-agent-batch-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) 0.8fr 0.7fr 1.1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
}

.monitoring-agent-batch-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.monitoring-agent-batch-row--head {
  background: transparent;
  border: 0;
  padding: 0 0.2rem;
}

.monitoring-agent-batch-row--head span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (max-width: 991.98px) {
  .monitoring-agent-batch-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoring-agent-batch-row--head {
    display: none;
  }
}

.settings-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-soft);
}

.settings-input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  padding: 0.85rem 1rem;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-input:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.settings-input.is-invalid {
  border-color: rgba(225, 29, 72, 0.55);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.14);
}

.settings-input-readonly {
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  border-style: dashed;
  cursor: not-allowed;
}

.settings-hint {
  margin-top: 0.2rem;
  color: var(--color-text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.settings-field-feedback {
  min-height: 1rem;
  font-size: 0.8rem;
  color: #e11d48;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.settings-actions .btn {
  min-height: 46px;
  border-radius: 14px;
  padding-inline: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.appearance-preview-stack {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.appearance-remove-asset-btn {
  justify-self: start;
  border-radius: 999px;
}

.appearance-section-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.appearance-section-head {
  margin-bottom: 0.95rem;
}

.appearance-section-head h6 {
  font-size: 1rem;
  font-weight: 700;
}

.appearance-section-head p {
  max-width: 70ch;
}

.appearance-mode-grid .settings-mode-option {
  height: 100%;
}

.appearance-advanced-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.appearance-advanced-panel[open] {
  background: rgba(15, 23, 42, 0.045);
}

.appearance-advanced-summary {
  list-style: none;
  display: grid;
  gap: 0.18rem;
  padding: 1rem 1.05rem;
  cursor: pointer;
}

.appearance-advanced-summary::-webkit-details-marker {
  display: none;
}

.appearance-advanced-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.55rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.appearance-advanced-summary strong {
  font-size: 1rem;
  color: #0f172a;
}

.appearance-advanced-summary > span:last-child {
  color: #64748b;
  max-width: 72ch;
}

.appearance-advanced-body {
  padding: 0 1.05rem 1.05rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.appearance-login-assets-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.appearance-login-assets-head {
  margin-bottom: 0.95rem;
}

.appearance-login-assets-panel #appearance-login-logo-preview,
.appearance-login-assets-panel #appearance-favicon-preview,
.appearance-login-assets-panel #appearance-login-background-image-preview {
  grid-template-columns: minmax(0, 1fr);
}

.upload-preview-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
  justify-content: flex-start;
}

.upload-preview-grid-compact .upload-preview-card {
  max-width: 220px;
}

#generic-images-preview.upload-preview-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
}

#generic-images-preview.upload-preview-grid-compact .upload-preview-card,
#generic-existing-images.upload-preview-grid-compact .upload-preview-card {
  max-width: 180px;
}

.upload-preview-card {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.upload-preview-card img {
  width: 100%;
  height: 120px;
  max-height: 120px;
  object-fit: cover;
  display: block;
}

#generic-images-preview .upload-preview-card img,
#generic-existing-images .upload-preview-card img {
  height: 96px;
  max-height: 96px;
}

.upload-preview-card-readonly img {
  object-fit: contain;
  background: #ffffff;
  padding: 0.75rem;
}

#appearance-logo-preview .upload-preview-card img,
#appearance-favicon-preview .upload-preview-card img,
#appearance-login-logo-preview .upload-preview-card img {
  object-fit: contain;
  background: #ffffff;
  padding: 0.75rem;
}

#appearance-footer-logo-preview {
  grid-template-columns: minmax(0, 220px);
}

#appearance-footer-logo-preview .upload-preview-card {
  max-width: 220px;
}

#appearance-footer-logo-preview .upload-preview-card img {
  height: 92px;
  max-height: 92px;
  object-fit: contain;
  background: #ffffff;
  padding: 0.9rem;
}

.upload-preview-card figcaption {
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-empty {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: #64748b;
  font-size: 0.88rem;
  background: rgba(248, 250, 252, 0.85);
}

.monitoring-data-table-left-head thead th {
  text-align: left;
}

.overview-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 32%),
    var(--gradient-hero-accent);
  color: var(--color-hero-accent-text);
  box-shadow: var(--shadow-hero-accent);
}

.overview-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-hero h2 {
  margin: 0.8rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.overview-hero p {
  margin: 0.65rem 0 0;
  max-width: 760px;
  color: rgba(226, 232, 240, 0.84);
  font-size: 1rem;
}

.overview-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.95rem;
}

.overview-hero-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-total-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.overview-fullscreen-btn {
  min-height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-inline: 1rem;
  font-weight: 700;
}

.overview-refresh-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  opacity: 0.82;
  flex: 0 0 auto;
}

.overview-refresh-btn:hover,
.overview-refresh-btn:focus-visible {
  opacity: 1;
}

.overview-refresh-btn i {
  font-size: 0.95rem;
}

.overview-refresh-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.18rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  min-width: 220px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.overview-monitoring-status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 1px solid transparent;
  text-align: left;
}

.overview-monitoring-status-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.overview-monitoring-status-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.overview-monitoring-status-copy strong {
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.overview-monitoring-status-copy span {
  font-size: 0.73rem;
  line-height: 1.35;
  opacity: 0.94;
}

.overview-monitoring-status.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(110, 231, 183, 0.24);
  color: #d1fae5;
}

.overview-monitoring-status.is-active .overview-monitoring-status-icon {
  background: rgba(16, 185, 129, 0.18);
  color: #bbf7d0;
}

.overview-monitoring-status.is-paused {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(253, 230, 138, 0.26);
  color: #fef3c7;
}

.overview-monitoring-status.is-paused .overview-monitoring-status-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.overview-refresh-label {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overview-summary-grid,
.overview-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.overview-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-stat-card,
.overview-category-card,
.overview-location-card,
.overview-surface,
.overview-incident-item {
  border-radius: 20px;
  border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.2));
  background: var(--theme-surface, rgba(255, 255, 255, 0.95));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.overview-stat-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.05rem;
}

.overview-stat-icon,
.overview-category-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

.overview-stat-label {
  display: block;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.84rem;
  font-weight: 600;
}

.overview-stat-value {
  display: block;
  color: var(--theme-text, #0f172a);
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.1;
}

.overview-category-card {
  padding: 1rem;
}

.overview-category-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.overview-category-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--theme-text, #0f172a);
}

.overview-category-head p {
  margin: 0.2rem 0 0;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.84rem;
}

.overview-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--theme-progress-track, rgba(226, 232, 240, 0.9));
  overflow: hidden;
}

.overview-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.95), rgba(16, 185, 129, 0.95));
}

.overview-category-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
  color: var(--theme-text-muted, #475569);
  font-size: 0.84rem;
}

.overview-category-foot strong {
  color: var(--theme-text, #0f172a);
}

.overview-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  grid-auto-rows: min-content;
}

.overview-priority-grid-single {
  align-items: start;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  grid-auto-rows: min-content;
}

.overview-alerts-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.overview-surface {
  padding: 1rem;
  height: auto;
  width: 100%;
  align-self: stretch;
}

.overview-surface-priority {
  border-color: color-mix(in srgb, var(--theme-border, rgba(148, 163, 184, 0.2)) 80%, rgba(244, 63, 94, 0.18));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 246, 247, 0.96));
}

.overview-surface-secondary {
  border-color: color-mix(in srgb, var(--theme-border, rgba(148, 163, 184, 0.2)) 82%, rgba(245, 158, 11, 0.14));
}

.overview-surface-unstable {
  border-color: color-mix(in srgb, var(--theme-border, rgba(148, 163, 184, 0.2)) 82%, rgba(139, 92, 246, 0.18));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 255, 0.96));
}

.overview-health-surface {
  min-width: 0;
  width: 100%;
}

.overview-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.overview-section-header h3 {
  margin: 0;
  color: var(--theme-text, #0f172a);
  font-size: 1.12rem;
}

.overview-section-header p {
  margin: 0.25rem 0 0;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.9rem;
}

.overview-alert-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.overview-alert-pill.is-ok {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.overview-alert-pill.is-offline {
  background: linear-gradient(90deg, #c20c0c, #ff3b3b);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.18);
  animation: heartbeat 0.8s infinite;
}

.overview-alert-pill.is-attending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.overview-alert-pill.is-unstable {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}

.overview-location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
  gap: 0.9rem;
  justify-content: start;
}

.overview-location-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.18));
}

.overview-location-card.has-issues {
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong, #ffffff) 90%, transparent), rgba(255, 241, 242, 0.92));
}

.overview-location-card.is-healthy {
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong, #ffffff) 90%, transparent), rgba(240, 253, 250, 0.92));
}

.overview-location-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.overview-location-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.overview-location-brand {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--theme-surface-strong, #ffffff) 92%, transparent);
  border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.22));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  flex: 0 0 auto;
}

.overview-location-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.35rem;
}

.overview-location-head h4 {
  margin: 0;
  color: var(--theme-text, #0f172a);
  font-size: 1rem;
}

.overview-location-head p {
  margin: 0.2rem 0 0;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.84rem;
}

.overview-location-rate {
  color: var(--theme-text, #0f172a);
  font-weight: 800;
}

.overview-location-bars {
  height: 0.5rem;
  margin: 0.85rem 0 0.7rem;
  border-radius: 999px;
  background: var(--theme-progress-track, rgba(226, 232, 240, 0.9));
  overflow: hidden;
}

.overview-location-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.overview-location-bar.is-online {
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.overview-location-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.overview-location-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--theme-chip-bg, rgba(15, 23, 42, 0.05));
  color: var(--theme-chip-text, #334155);
  font-size: 0.76rem;
  font-weight: 700;
}

.overview-incidents-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  overflow: hidden;
  align-content: start;
}

.overview-incident-item {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  align-items: stretch;
  padding: 0.66rem 0.72rem;
  min-height: 0;
}

.overview-incident-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.62rem;
  align-items: flex-start;
}

.overview-incident-icon {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}

.overview-incident-line {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem;
}

.overview-incident-line strong {
  color: var(--theme-text, #0f172a);
  font-size: 0.84rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}

.overview-incident-line span,
.overview-incident-meta {
  color: var(--theme-text-muted, #64748b);
  font-size: 0.73rem;
}

.overview-incident-subline {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  margin-top: 0.16rem;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.73rem;
  justify-content: flex-start;
}

.overview-incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.16rem;
}

.overview-incident-detail-line {
  margin-top: 0.14rem;
  color: var(--theme-text-muted, #64748b);
  font-size: 0.73rem;
}

.overview-incident-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.72rem;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-incident-status.is-attending {
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
}

.overview-incident-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.34rem;
  min-width: 82px;
}

.overview-surface-priority .overview-incidents-list,
.overview-surface-secondary .overview-incidents-list {
  max-width: 100%;
}

.overview-surface-priority .overview-incident-item,
.overview-surface-secondary .overview-incident-item {
  max-width: 100%;
}

.overview-incident-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 92px;
}

.btn.overview-incident-action,
.overview-incident-action {
  min-height: 1.72rem;
  min-width: 1.92rem;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: #0f172a !important;
  color: #facc15 !important;
  border: 1px solid rgba(15, 23, 42, 0.94) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.btn.overview-incident-action.is-active,
.overview-incident-action.is-active {
  background: #0f172a;
  color: #facc15;
}

.overview-incident-attendance {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.08rem 0;
  border-radius: 999px;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.69rem;
  font-weight: 700;
}

.overview-incident-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.overview-incident-attendance-line {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  flex-wrap: wrap;
}

.overview-incident-divider {
  width: 90%;
  margin: 0.04rem auto 0;
  border-top: 1px dashed rgba(59, 130, 246, 0.4);
}

.overview-incident-footer {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.overview-incident-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.overview-incident-line > span {
  white-space: nowrap;
}

.overview-incident-attendance-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-size: 0.66rem;
  font-weight: 800;
}

.overview-incident-attendance-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn.overview-incident-action:not(.is-active),
.overview-incident-action:not(.is-active) {
  border: 1px solid rgba(15, 23, 42, 0.94);
  background: #0f172a;
  color: #facc15;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.btn.overview-incident-action:hover,
.btn.overview-incident-action:focus,
.btn.overview-incident-action:active,
.overview-incident-action:not(.is-active):hover {
  background: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.94) !important;
  color: #facc15 !important;
  transform: none;
}

.overview-incident-action.is-active {
  min-width: 2rem;
  justify-content: center;
}

.overview-incident-item.is-acknowledged {
  border-left-color: rgba(244, 63, 94, 0.42);
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong, #ffffff) 92%, transparent), rgba(255,241,242,0.94));
}

.overview-incident-item.is-acknowledged .overview-incident-status {
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
}


.overview-empty {
  padding: 1.5rem 1rem;
  border-radius: 18px;
  border: 1px dashed color-mix(in srgb, var(--theme-border-strong, rgba(148, 163, 184, 0.26)) 90%, transparent);
  color: var(--theme-text-muted, #64748b);
  text-align: center;
}

.overview-tone-slate .overview-stat-icon,
.overview-tone-slate .overview-category-icon {
  background: linear-gradient(135deg, #334155, #64748b);
}

.overview-tone-emerald .overview-stat-icon,
.overview-tone-emerald .overview-category-icon {
  background: linear-gradient(135deg, #047857, #10b981);
}

.overview-tone-rose .overview-stat-icon,
.overview-tone-rose .overview-category-icon {
  background: linear-gradient(135deg, #be123c, #fb7185);
}

.overview-tone-blue .overview-stat-icon,
.overview-tone-blue .overview-category-icon {
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.overview-tone-cyan .overview-category-icon {
  background: linear-gradient(135deg, #0f766e, #06b6d4);
}

.overview-tone-amber .overview-category-icon {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

.overview-tone-violet .overview-category-icon {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

@media (max-width: 1399.98px) {
  .overview-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .overview-hero {
    grid-template-columns: 1fr;
  }

  .overview-hero-actions {
    align-items: stretch;
  }

  .overview-refresh-meta {
    align-items: flex-start;
  }

  .overview-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-priority-grid {
    grid-template-columns: 1fr;
  }

  .overview-priority-grid-single {
    grid-template-columns: 1fr;
  }

  .overview-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .overview-summary-grid,
  .overview-category-grid,
  .overview-location-grid {
    grid-template-columns: 1fr;
  }

  .overview-priority-grid {
    grid-template-columns: 1fr;
  }

  .overview-priority-grid-single {
    grid-template-columns: 1fr;
  }

  .overview-section-header,
  .overview-incident-line,
  .overview-incident-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-incident-top {
    display: flex;
  }

  .overview-incident-side {
    width: 100%;
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }

  .overview-location-title-row {
    align-items: flex-start;
  }

  .overview-location-brand {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.overview-refresh-interval {
  margin-top: 0.15rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.76rem;
}

.overview-fullscreen-btn i {
  margin-right: 0.25rem;
}

.overview-incidents-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.62rem;
}

.overview-incidents-caption,
.overview-incidents-page,
.overview-incidents-count {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.overview-incidents-toolbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.overview-incidents-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.overview-incidents-pager .btn {
  min-width: 1.86rem;
  min-height: 1.86rem;
  border-radius: 999px;
  padding: 0;
}

.overview-incidents-list-animated {
  animation: overview-fade-in 320ms ease;
  overflow: hidden;
}

/* will-change so em opacity: a lista anterior (transform, filter) promovia
   TODO filho do #dash a camada de composicao propria, de forma permanente --
   custo de memoria e artefato de repintura sem nenhuma dessas propriedades
   sendo animada. */
#dash > * {
  will-change: opacity;
}

#dash > *.dash-motion-enter {
  animation: dash-surface-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.overview-incident-item-alert {
  position: relative;
  border-left: 6px solid rgba(194, 12, 12, 0.88);
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
  box-shadow: 0 4px 14px rgba(194, 12, 12, 0.12);
}

.overview-incident-item.is-unstable {
  border-left-color: rgba(124, 58, 237, 0.72);
  background: linear-gradient(180deg, #faf5ff 0%, #f6f1ff 100%);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.1);
}

.overview-stat-card,
.overview-category-card,
.overview-surface,
.overview-location-card,
.overview-incident-item {
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.overview-stat-card:hover,
.overview-category-card:hover,
.overview-location-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.overview-incident-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.07);
}

.overview-surface-priority .overview-incidents-toolbar {
  background: #fff1f1;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}

.overview-surface-priority .overview-incidents-caption,
.overview-surface-priority .overview-incidents-page,
.overview-surface-priority .overview-incidents-count {
  color: #b42318;
}

.overview-surface-priority .overview-incidents-pager .btn {
  border-color: rgba(194, 12, 12, 0.18);
  background: #ffffff;
  color: #8a2a2a;
}

.overview-surface-priority .overview-incidents-pager .btn:hover:not(:disabled) {
  background: #fff6f6;
  color: #c20c0c;
}

.overview-surface-priority .overview-incident-item-alert::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, #c20c0c, #ff0000);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
  box-shadow: inset 0 0 8px rgba(255, 0, 0, 0.35);
}

.overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) {
  animation: heartbeatShadow 0.8s infinite;
}

.overview-surface-priority .overview-incident-icon {
  background: #ffe6e6;
  color: #c20c0c;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.18);
}

.overview-incident-priority-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  line-height: 1;
}

.overview-surface-priority .overview-incident-line strong {
  color: #8f1515;
}

.overview-surface-priority .overview-incident-detail-line,
.overview-surface-priority .overview-incident-subline,
.overview-surface-priority .overview-incident-line span {
  color: #7a2c30;
}

.overview-surface-priority .overview-incident-status {
  background: linear-gradient(90deg, #c20c0c, #ff0000);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.overview-incident-status.is-attending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  box-shadow: none;
}

.overview-incident-status.is-unstable {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
  box-shadow: none;
}

.overview-alert-pill.is-offline,
.overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) .overview-incident-icon,
.overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) .overview-incident-status {
  animation: heartbeat 0.8s infinite;
}

.overview-surface-priority .overview-incident-action:not(.is-active) {
  background: #0f172a;
  color: #facc15;
  border-color: rgba(15, 23, 42, 0.94);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.overview-surface-priority .overview-incident-action:not(.is-active):hover {
  background: #0f172a;
  color: #facc15;
  transform: none;
}

.overview-incident-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.overview-incident-metrics.is-inline-attending {
  flex-wrap: nowrap;
  align-items: center;
}

.overview-incident-metric {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.overview-incident-metric.is-offline {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.overview-incident-metric.is-attending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.overview-incident-metric.is-unstable {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}

.overview-incident-metric.is-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.monitoring-ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.monitoring-ticket-badge.is-inline-meta {
  width: fit-content;
  margin-top: 0.22rem;
}

.monitoring-ticket-badge.is-side-badge {
  align-self: flex-end;
}

.monitoring-status-meta {
  display: block;
  font-size: 0.74rem;
  color: #475569;
  line-height: 1.35;
}

.monitoring-status-meta.is-offline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.12);
  color: #be123c;
  font-weight: 700;
  animation: heartbeat 0.8s infinite;
}

.monitoring-status-meta.is-secondary {
  color: #64748b;
}

.monitoring-ack-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  font-size: 0.84rem;
}

.monitoring-ack-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.monitoring-ack-timeline-label {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.monitoring-ack-timeline-list {
  display: grid;
  gap: 0.55rem;
}

.monitoring-timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.monitoring-timeline-item strong {
  margin: 0;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
}

.monitoring-timeline-item span {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
}

.monitoring-timeline-item.is-offline {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(244, 63, 94, 0.16);
}

.monitoring-timeline-item.is-offline strong,
.monitoring-timeline-item.is-offline span {
  color: #be123c;
}

.monitoring-timeline-item.is-attending {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.16);
}

.monitoring-timeline-item.is-attending strong,
.monitoring-timeline-item.is-attending span {
  color: #b45309;
}

.monitoring-timeline-item.is-unstable {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(124, 58, 237, 0.16);
}

.monitoring-timeline-item.is-unstable strong,
.monitoring-timeline-item.is-unstable span {
  color: #6d28d9;
}

.monitoring-ack-note-input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 10rem !important;
  margin: 0.9rem 0 0 !important;
}

.monitoring-history-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.monitoring-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.58rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.2;
}

.monitoring-history-chip strong {
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
}

.monitoring-history-chip span {
  color: inherit;
  font-weight: 700;
}

.monitoring-history-chip.is-offline {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(244, 63, 94, 0.16);
  color: #be123c;
}

.monitoring-history-chip.is-attending {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.monitoring-history-chip.is-unstable {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(124, 58, 237, 0.18);
  color: #6d28d9;
}

.monitoring-history-chip.is-neutral {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.18);
  color: #475569;
}

@keyframes overview-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.16); }
  28% { transform: scale(1); }
  42% { transform: scale(1.16); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes heartbeatShadow {
  0% { box-shadow: 0 4px 14px rgba(194, 12, 12, 0.12); }
  14% { box-shadow: 0 8px 24px rgba(255, 0, 0, 0.24); }
  28% { box-shadow: 0 4px 14px rgba(194, 12, 12, 0.12); }
  42% { box-shadow: 0 8px 24px rgba(255, 0, 0, 0.24); }
  70% { box-shadow: 0 4px 14px rgba(194, 12, 12, 0.12); }
  100% { box-shadow: 0 4px 14px rgba(194, 12, 12, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .status-offline,
  .status-offline .status-dot,
  .generic-device-state-pill.is-danger,
  .monitoring-status-meta.is-offline,
  .overview-alert-pill.is-offline,
  .overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged),
  .overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) .overview-incident-icon,
  .overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) .overview-incident-status {
    animation: none !important;
  }
}

@media (min-width: 1700px) {
  .overview-priority-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .overview-priority-grid-single {
    grid-template-columns: fit-content(var(--overview-priority-width, calc((var(--overview-priority-columns, 2) * 400px) + ((var(--overview-priority-columns, 2) - 1) * 12px)))) minmax(0, 1fr);
  }

  .overview-surface-priority .overview-incidents-list,
  .overview-surface-secondary .overview-incidents-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
    align-items: start;
    justify-content: start;
  }

  .overview-surface-priority .overview-incidents-list {
    grid-template-columns: repeat(var(--overview-render-columns, var(--overview-desktop-columns, 4)), minmax(0, 400px));
  }

  .overview-surface-secondary .overview-incidents-list {
    grid-template-columns: repeat(var(--overview-render-columns, var(--overview-desktop-columns, 2)), minmax(0, 400px));
  }

  .overview-surface-priority {
    width: 100%;
  }

  .overview-surface-secondary {
    width: 100%;
    justify-self: stretch;
  }

  .overview-surface-priority .overview-incident-item,
  .overview-surface-secondary .overview-incident-item {
    max-width: 400px;
  }

  .overview-location-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
  }
}

:fullscreen .dashboard-nav,
:fullscreen .container-footer,
:-webkit-full-screen .dashboard-nav,
:-webkit-full-screen .container-footer {
  display: none !important;
}

:fullscreen .dashboard-toolbar .menu-toggle,
:fullscreen .dashboard-toolbar .dropdown,
:-webkit-full-screen .dashboard-toolbar .menu-toggle,
:-webkit-full-screen .dashboard-toolbar .dropdown {
  display: none !important;
}

:fullscreen .dashboard-app,
:-webkit-full-screen .dashboard-app {
  width: 100% !important;
  margin-left: 0 !important;
  height: 100vh !important;
}

:fullscreen .dashboard-content,
:-webkit-full-screen .dashboard-content {
  background-image: none !important;
  background-size: 0 !important;
}

:fullscreen .dashboard-toolbar,
:-webkit-full-screen .dashboard-toolbar {
  grid-template-columns: 1fr;
  justify-items: center;
}

:fullscreen #dash,
:-webkit-full-screen #dash {
  padding: 1rem 1.25rem;
}

@media (max-width: 767.98px) {
  .overview-incidents-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.overview-category-icon img,
.overview-incident-icon img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  display: block;
}


.device-type-tone-select {
  color: #ffffff;
  font-weight: 700;
  border-width: 2px;
}

.device-type-tone-select.ds-field,
.device-type-tone-select {
  color: #fff;
}

.device-type-tone-select.overview-tone-slate {
  background: linear-gradient(135deg, #334155, #64748b);
  border-color: #334155;
}

.device-type-tone-select.overview-tone-cyan {
  background: linear-gradient(135deg, #0f766e, #06b6d4);
  border-color: #0f766e;
}

.device-type-tone-select.overview-tone-blue {
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  border-color: #1d4ed8;
}

.device-type-tone-select.overview-tone-amber {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  border-color: #b45309;
}

.device-type-tone-select.overview-tone-violet {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  border-color: #6d28d9;
}

.device-type-tone-select.overview-tone-emerald {
  background: linear-gradient(135deg, #047857, #10b981);
  border-color: #047857;
}

.device-type-tone-select.overview-tone-rose {
  background: linear-gradient(135deg, #be123c, #fb7185);
  border-color: #be123c;
}

.device-type-tone-select option {
  color: var(--color-text);
  background: var(--color-surface-solid);
}

.device-type-tcp-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.device-type-tcp-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.device-type-tcp-preset-card strong {
  color: var(--color-text);
  font-size: 0.95rem;
}

.device-type-tcp-preset-card span {
  color: var(--color-text-soft);
  font-size: 0.83rem;
  line-height: 1.45;
}

.device-type-tcp-preset-card small {
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
}

.device-type-tcp-preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.device-type-tcp-preset-card.is-selected {
  border-color: rgba(29, 78, 216, 0.42);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.95));
  box-shadow: 0 12px 26px rgba(29, 78, 216, 0.14);
}

:root {
  --theme-app-bg: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  --theme-page-bg: #f3f6fb;
  --theme-surface: rgba(255, 255, 255, 0.95);
  --theme-surface-strong: #ffffff;
  --theme-surface-muted: #f8fafc;
  --theme-border: rgba(148, 163, 184, 0.2);
  --theme-border-strong: rgba(148, 163, 184, 0.26);
  --theme-text: #0f172a;
  --theme-text-muted: #64748b;
  --theme-chip-bg: rgba(15, 23, 42, 0.05);
  --theme-chip-text: #334155;
  --theme-progress-track: rgba(226, 232, 240, 0.9);
}


:root[data-theme-mode="dark"] body,
:root[data-theme-mode="dark"] .dashboard-content,
:root[data-theme-mode="dark"] #dash {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] {
  --theme-app-bg: linear-gradient(180deg, #07111f 0%, #0b1728 100%);
  --theme-page-bg: #07111f;
  --theme-surface: rgba(15, 23, 42, 0.9);
  --theme-surface-strong: #111827;
  --theme-surface-muted: #0b1220;
  --theme-border: rgba(148, 163, 184, 0.22);
  --theme-border-strong: rgba(148, 163, 184, 0.28);
  --theme-text: #e2e8f0;
  --theme-text-muted: #94a3b8;
  --theme-chip-bg: rgba(148, 163, 184, 0.12);
  --theme-chip-text: #dbe7f5;
  --theme-progress-track: rgba(51, 65, 85, 0.82);
}

:root[data-theme-mode="light"] {
  --theme-app-bg: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  --theme-page-bg: #f3f6fb;
  --theme-surface: rgba(255, 255, 255, 0.96);
  --theme-surface-strong: #ffffff;
  --theme-surface-muted: #f8fafc;
  --theme-border: rgba(148, 163, 184, 0.2);
  --theme-border-strong: rgba(148, 163, 184, 0.26);
  --theme-text: #0f172a;
  --theme-text-muted: #64748b;
  --theme-chip-bg: rgba(15, 23, 42, 0.05);
  --theme-chip-text: #334155;
  --theme-progress-track: rgba(226, 232, 240, 0.9);
}

:root[data-theme-mode="dark"] .card,
:root[data-theme-mode="dark"] .admin-entity-card,
:root[data-theme-mode="dark"] .monitoring-panel,
:root[data-theme-mode="dark"] .swal2-popup,
:root[data-theme-mode="dark"] .import-hint-box,
:root[data-theme-mode="dark"] .upload-preview-card,
:root[data-theme-mode="dark"] .settings-mode-option,
:root[data-theme-mode="dark"] .device-type-tcp-preset-card {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

:root[data-theme-mode="dark"] .card-header.bg-light,
:root[data-theme-mode="dark"] .card-body,
:root[data-theme-mode="dark"] .card-footer,
:root[data-theme-mode="dark"] .table,
:root[data-theme-mode="dark"] .table td,
:root[data-theme-mode="dark"] .table th,
:root[data-theme-mode="dark"] .form-control,
:root[data-theme-mode="dark"] .form-select,
:root[data-theme-mode="dark"] .input-group-text,
:root[data-theme-mode="dark"] .form-check-label,
:root[data-theme-mode="dark"] .text-muted,
:root[data-theme-mode="dark"] .nav-tabs .nav-link,
:root[data-theme-mode="dark"] .admin-empty-state,
:root[data-theme-mode="dark"] .dash-empty-state,
:root[data-theme-mode="dark"] .upload-preview-empty {
  background-color: #111827 !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme-mode="dark"] .form-control,
:root[data-theme-mode="dark"] .form-select,
:root[data-theme-mode="dark"] .input-group-text {
  background: #0b1220 !important;
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .text-muted,
:root[data-theme-mode="dark"] small.text-muted {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] .nav-tabs .nav-link.active,
:root[data-theme-mode="dark"] .btn-outline-dark:hover,
:root[data-theme-mode="dark"] .btn-outline-secondary:hover {
  background: #1d4ed8 !important;
  color: #eff6ff !important;
}

:root[data-theme-mode="light"] .dashboard-content,
:root[data-theme-mode="light"] #dash {
  color: #0f172a;
}

:root[data-theme-mode="light"] .card,
:root[data-theme-mode="light"] .admin-entity-card,
:root[data-theme-mode="light"] .monitoring-panel,
:root[data-theme-mode="light"] .upload-preview-card,
:root[data-theme-mode="light"] .settings-mode-option,
:root[data-theme-mode="light"] .device-type-tcp-preset-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

:root[data-theme-mode="light"] .card-header.bg-light,
:root[data-theme-mode="light"] .form-control,
:root[data-theme-mode="light"] .form-select,
:root[data-theme-mode="light"] .input-group-text,
:root[data-theme-mode="light"] .upload-preview-empty {
  background-color: #f8fafc !important;
}

:root[data-theme-mode="dark"] body {
  background: var(--theme-page-bg);
}

:root[data-theme-mode="dark"] .dashboard {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 24%),
    var(--theme-app-bg);
}

:root[data-theme-mode="dark"] .dashboard-content {
  background-color: var(--theme-page-bg);
  background-image: none;
}

/* Reforco: #dash (scroll do conteudo) e .dashboard-app sao transparentes por
   padrao e so herdam o escuro do pai. Damos fundo escuro explicito no escuro
   pra nunca aparecer branco em telas com pouco conteudo (ex.: Fornecedores). */
:root[data-theme-mode="dark"] .dashboard-app,
:root[data-theme-mode="dark"] #dash {
  background-color: var(--theme-page-bg);
}

:root[data-theme-mode="dark"] .brand-logo img,
:root[data-theme-mode="dark"] .login img {
  background: var(--color-surface-raised);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

:root[data-theme-mode="dark"] #company-locations-menu,
:root[data-theme-mode="dark"] #company-locations-menu .dashboard-nav-dropdown,
:root[data-theme-mode="dark"] #company-locations-menu .dashboard-nav-dropdown-menu {
  background: var(--color-nav);
}

:root[data-theme-mode="light"] body {
  background: var(--theme-page-bg);
}

:root[data-theme-mode="light"] .dashboard {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 24%),
    var(--theme-app-bg);
}

:root[data-theme-mode="dark"] #dash .bg-light:not(.btn):not(.badge):not(.dropdown-menu):not(.modal-content),
:root[data-theme-mode="dark"] #dash .alert-light,
:root[data-theme-mode="dark"] #dash .border.rounded-4.p-3.bg-light,
:root[data-theme-mode="dark"] #dash .border.rounded-3.p-3.bg-light,
:root[data-theme-mode="dark"] #dash .card-header.bg-light,
:root[data-theme-mode="dark"] #dash .card-footer,
:root[data-theme-mode="dark"] #dash .upload-preview-empty,
:root[data-theme-mode="dark"] #dash .admin-empty-state,
:root[data-theme-mode="dark"] #dash .dash-empty-state {
  background: var(--theme-surface-muted) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme-mode="dark"] #dash .border,
:root[data-theme-mode="dark"] #dash .card,
:root[data-theme-mode="dark"] #dash .admin-entity-card,
:root[data-theme-mode="dark"] #dash .monitoring-panel,
:root[data-theme-mode="dark"] #dash .upload-preview-card,
:root[data-theme-mode="dark"] #dash .settings-mode-option,
:root[data-theme-mode="dark"] #dash .device-type-tcp-preset-card,
:root[data-theme-mode="dark"] #dash .overview-stat-card,
:root[data-theme-mode="dark"] #dash .overview-category-card,
:root[data-theme-mode="dark"] #dash .overview-location-card,
:root[data-theme-mode="dark"] #dash .overview-surface,
:root[data-theme-mode="dark"] #dash .overview-incident-item {
  border-color: var(--theme-border) !important;
}

:root[data-theme-mode="dark"] #dash .text-muted,
:root[data-theme-mode="dark"] #dash small.text-muted,
:root[data-theme-mode="dark"] #dash .form-check-label,
:root[data-theme-mode="dark"] #dash .overview-stat-label,
:root[data-theme-mode="dark"] #dash .overview-category-head p,
:root[data-theme-mode="dark"] #dash .overview-section-header p,
:root[data-theme-mode="dark"] #dash .overview-location-head p,
:root[data-theme-mode="dark"] #dash .overview-incident-line span,
:root[data-theme-mode="dark"] #dash .overview-incident-meta,
:root[data-theme-mode="dark"] #dash .overview-incident-subline,
:root[data-theme-mode="dark"] #dash .overview-incident-detail-line,
:root[data-theme-mode="dark"] #dash .overview-empty {
  color: var(--theme-text-muted) !important;
}

:root[data-theme-mode="dark"] #dash .overview-stat-value,
:root[data-theme-mode="dark"] #dash .overview-category-head h3,
:root[data-theme-mode="dark"] #dash .overview-category-foot strong,
:root[data-theme-mode="dark"] #dash .overview-section-header h3,
:root[data-theme-mode="dark"] #dash .overview-location-head h4,
:root[data-theme-mode="dark"] #dash .overview-location-rate,
:root[data-theme-mode="dark"] #dash .overview-incident-line strong {
  color: var(--theme-text) !important;
}

.dashboard-nav {
  width: 264px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(15, 23, 42, 0.16)),
    var(--custom-nav-bg, #1a1a21);
  box-shadow: 20px 0 45px rgba(2, 6, 23, 0.16);
}

.dashboard-nav header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 76px;
  padding: 1rem 1.15rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(15, 23, 42, 0.16)),
    var(--custom-profile-button-bg, #6c757d) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  text-decoration: none;
}

.brand-logo img {
  max-width: 94px;
  max-height: 36px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #f8fafc;
}

.brand-copy strong {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-copy small {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.dashboard-nav-list {
  padding: 1rem 0.9rem 1.15rem;
}

#company-locations-menu,
#company-locations-menu .dashboard-nav-dropdown,
#company-locations-menu .dashboard-nav-dropdown-menu,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown.bg-secondary {
  background: transparent !important;
}

.dashboard-nav-item,
.dashboard-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.85rem;
  margin-bottom: 0.22rem;
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  color: rgba(226, 232, 240, 0.84);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-nav-item:hover,
.dashboard-nav-dropdown-item:hover,
.dashboard-nav-dropdown-toggle.show,
.dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.dashboard-nav-dropdown-menu {
  margin-left: 0.35rem;
  padding: 0.22rem 0 0.45rem 0.8rem;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
}

.dashboard-nav-dropdown-menu .dashboard-nav-item,
.dashboard-nav-dropdown-item {
  min-height: 2.55rem;
  padding-block: 0.62rem;
  font-size: 0.85rem;
  font-weight: 600;
}

#admin-nav {
  margin-bottom: 0.35rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(15, 23, 42, 0.12)),
    var(--custom-profile-button-bg, #6c757d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dashboard-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(15, 23, 42, 0.14)),
    var(--custom-toolbar-bg, #18181b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.dashboard-toolbar-start {
  gap: 0.9rem;
}

.dashboard-toolbar h1 {
  font-size: clamp(0.96rem, 1.2vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #f8fafc;
}

#dashboard-button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  min-height: 56px;
  padding: 0.45rem 0.7rem 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(15, 23, 42, 0.1)),
    var(--custom-profile-button-bg, #6c757d);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

#dashboard-button:hover,
#dashboard-button:focus,
#dashboard-button.show {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
}

.dashboard-user-avatar-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

#dashboard-button .avatar {
  width: 2.35rem;
  height: 2.35rem;
  margin-right: 0;
  border-radius: 14px;
  object-fit: cover;
}

.dashboard-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.dashboard-user-meta strong,
#dashboard-button span#user-name {
  display: block;
  max-width: 180px;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
}

.dashboard-user-meta small {
  max-width: 180px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-user-caret {
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.8rem;
}

#profile-anchor.dropdown-menu {
  min-width: 216px;
  max-width: 216px;
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(16px);
}

.login-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
  color: #2563eb;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.login-secondary-action:hover {
  border-color: rgba(37, 99, 235, 0.34);
  color: #1d4ed8 !important;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.login-secondary-action:focus-visible {
  outline: 0;
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.requester-auth-body,
.requester-portal-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34%),
    linear-gradient(180deg, var(--color-surface-muted) 0%, var(--color-bg) 100%);
  overflow-y: auto;
}

.requester-auth-shell,
.requester-portal-shell {
  width: min(1200px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.requester-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.88fr);
  gap: 28px;
  align-items: center;
}

.requester-auth-showcase,
.requester-auth-card,
.requester-page-shell,
.requester-portal-topbar {
  border-radius: 28px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.requester-auth-showcase {
  padding: 40px;
  background: linear-gradient(135deg, #172036 0%, #283a5d 100%);
  color: #f8fafc;
}

.requester-auth-eyebrow,
.requester-portal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.requester-auth-showcase h1 {
  margin: 18px 0 14px;
  font-size: clamp(2rem, 2.8vw, 3rem);
  line-height: 1.08;
  font-weight: 800;
}

.requester-auth-showcase p {
  max-width: 34rem;
  margin: 0;
  color: rgba(241, 245, 249, 0.82);
  font-size: 1rem;
  line-height: 1.7;
}

.requester-auth-card {
  padding: 32px;
  background: var(--color-surface);
}

.requester-auth-card-head,
.requester-list-head,
.requester-ticket-interaction > header,
.requester-ticket-history > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.requester-auth-card-head {
  margin-bottom: 24px;
}

.requester-auth-card-head h2,
.requester-list-head h3 {
  margin: 0.35rem 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
}

.requester-auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.22rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.requester-auth-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.requester-auth-link:hover,
.requester-auth-link:focus {
  color: #1d4ed8 !important;
  text-decoration: underline;
}

.requester-auth-swal {
  width: min(32rem, calc(100vw - 2rem)) !important;
  padding: 1.35rem 1.4rem 1.25rem !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted)) !important;
  box-shadow: var(--shadow-lg) !important;
}

.requester-auth-swal .swal2-title.requester-auth-swal-title {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.9rem, 2.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.requester-auth-swal .swal2-html-container.requester-auth-swal-copy {
  margin: 0.6rem 0 0;
  padding: 0;
}

.requester-auth-swal-text {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.requester-auth-swal .swal2-input.requester-auth-swal-input {
  height: 54px;
  margin: 1.1rem 0 0 !important;
  border-radius: 16px !important;
  border: 1px solid var(--color-border) !important;
  background:
    linear-gradient(180deg, var(--color-surface-solid), var(--color-surface-muted)) !important;
  color: var(--color-text) !important;
  box-shadow: var(--shadow-sm) !important;
}

.requester-auth-swal .swal2-input.requester-auth-swal-input:focus {
  border-color: rgba(59, 130, 246, 0.42) !important;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 16px 30px rgba(37, 99, 235, 0.08) !important;
}

.requester-auth-swal .swal2-actions.requester-auth-swal-actions {
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.requester-auth-swal .requester-auth-swal-confirm,
.requester-auth-swal .requester-auth-swal-cancel {
  min-height: 48px;
  margin: 0 !important;
  padding: 0.78rem 1.2rem;
  border-radius: 15px;
  border: 1px solid transparent;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.requester-auth-swal .requester-auth-swal-confirm {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0ea5e9 100%);
  color: #f8fafc;
  border-color: rgba(37, 99, 235, 0.92);
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.requester-auth-swal .requester-auth-swal-confirm:hover,
.requester-auth-swal .requester-auth-swal-confirm:focus,
.requester-auth-swal .requester-auth-swal-confirm:active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 55%, #0284c7 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow:
    0 22px 38px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.requester-auth-swal .requester-auth-swal-cancel {
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.requester-auth-swal .requester-auth-swal-cancel:hover,
.requester-auth-swal .requester-auth-swal-cancel:focus,
.requester-auth-swal .requester-auth-swal-cancel:active {
  background: var(--color-border) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
  transform: translateY(-1px);
}

.requester-auth-form {
  display: grid;
  gap: 1rem;
}

.requester-auth-form label,
.requester-ticket-meta-list div {
  display: grid;
  gap: 0.42rem;
}

.requester-auth-form span,
.requester-context-label,
.requester-ticket-side-kicker,
.requester-ticket-meta-list span {
  color: var(--color-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.requester-auth-form small,
.requester-ticket-meta-list small {
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

.requester-auth-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.requester-portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 20px;
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.96);
}

.requester-portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: #f8fafc;
}

.requester-portal-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  padding: 0.45rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.94));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.requester-portal-brand strong,
.requester-portal-brand span {
  display: block;
}

.requester-portal-brand span {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.9rem;
}

.requester-portal-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.requester-portal-topbar-actions .btn {
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.requester-portal-topbar-actions .btn-primary:hover,
.requester-portal-topbar-actions .btn-primary:focus,
.requester-portal-topbar-actions .btn-primary:active {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24) !important;
  transform: translateY(-1px);
}

.requester-portal-topbar-actions .btn-outline-secondary {
  border-color: rgba(148, 163, 184, 0.48);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.requester-portal-topbar-actions .btn-outline-secondary:hover,
.requester-portal-topbar-actions .btn-outline-secondary:focus,
.requester-portal-topbar-actions .btn-outline-secondary:active {
  border-color: rgba(96, 165, 250, 0.55) !important;
  background: rgba(37, 99, 235, 0.18) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18) !important;
  transform: translateY(-1px);
}

.requester-portal-topbar-actions #requester-logout-button {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.88);
  color: #fff1f2;
  box-shadow: 0 12px 28px rgba(127, 29, 29, 0.18);
}

.requester-portal-topbar-actions #requester-logout-button:hover,
.requester-portal-topbar-actions #requester-logout-button:focus,
.requester-portal-topbar-actions #requester-logout-button:active {
  border-color: rgba(252, 165, 165, 0.7) !important;
  background: rgba(153, 27, 27, 0.96) !important;
  color: #fff1f2 !important;
  box-shadow: 0 16px 30px rgba(127, 29, 29, 0.24) !important;
  transform: translateY(-1px);
}

.requester-page-shell {
  padding: 20px;
  background: var(--color-surface);
}

.requester-portal-hero {
  margin-bottom: 18px;
}

.requester-portal-hero h2 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 2.7vw, 2.8rem);
  font-weight: 800;
}

.requester-portal-hero p {
  max-width: 52rem;
  margin: 0;
  color: rgba(241, 245, 249, 0.84);
}

.requester-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.requester-dashboard-card {
  padding: 1.2rem 1.35rem;
  border-radius: 22px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.requester-dashboard-card:hover,
.requester-dashboard-card.is-active {
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 28px 58px rgba(37, 99, 235, 0.14);
}

.requester-dashboard-card span {
  display: block;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  font-weight: 700;
}

.requester-dashboard-card strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--color-text);
  font-size: clamp(1.9rem, 2.2vw, 2.5rem);
  font-weight: 800;
}

.requester-dashboard-card small {
  display: block;
  margin-top: 0.5rem;
  color: var(--color-text-soft);
  line-height: 1.45;
}

.requester-list-shell,
.requester-ticket-create,
.requester-ticket-detail-shell {
  margin-top: 18px;
  padding: 1.2rem;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.requester-list-head {
  margin-bottom: 1rem;
}

.requester-list-head p,
.requester-ticket-interaction p {
  margin: 0.35rem 0 0;
  color: var(--color-text-soft);
}

.requester-ticket-list {
  display: grid;
  gap: 0.85rem;
}

.requester-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.requester-ticket-row:hover {
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.1);
}

.requester-ticket-row-head {
  display: grid;
  gap: 0.2rem;
}

.requester-ticket-row-head span {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.requester-ticket-row-head strong {
  color: var(--color-text);
  font-size: 1rem;
}

.requester-ticket-row small,
.requester-ticket-row-meta small {
  color: var(--color-text-soft);
}

.requester-ticket-row-meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.requester-ticket-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
}

.requester-ticket-create,
.requester-ticket-detail-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.26fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.requester-ticket-create-side,
.requester-ticket-sidebar {
  display: grid;
  gap: 0.85rem;
  align-self: start;
  min-width: 0;
}

.requester-context-card,
.requester-ticket-summary-card,
.requester-ticket-meta-list {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

/* O e-mail do solicitante é uma palavra sem ponto de quebra: sem min-width zero
   e quebra forçada, o min-content dele estoura a coluna da aside e o card é
   pintado por cima dos campos "Serviço" e "Prioridade". */
.requester-context-card {
  display: grid;
  gap: 0.35rem;
  min-height: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.requester-context-card strong,
.requester-ticket-summary-card h3,
.requester-ticket-meta-list strong {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
}

.requester-context-card small,
.requester-ticket-summary-card p {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-text-soft);
  line-height: 1.55;
}

.requester-ticket-summary-card h3 {
  margin: 0.45rem 0 0.25rem;
  font-size: 1.2rem;
}

.requester-ticket-summary-card .requester-ticket-meta-list {
  margin-top: 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.requester-ticket-main {
  display: grid;
  gap: 1rem;
}

.requester-ticket-history-list {
  display: grid;
  gap: 0.9rem;
}

.requester-history-entry {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
}

.requester-history-entry header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.requester-history-entry header strong {
  display: block;
  color: var(--color-text);
}

.requester-history-entry header span,
.requester-history-entry header small {
  color: var(--color-text-soft);
}

.requester-history-body {
  color: var(--color-text);
  line-height: 1.7;
}

.requester-history-body img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  cursor: zoom-in;
}

.requester-history-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.requester-history-files a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.requester-empty-state {
  display: grid;
  gap: 0.45rem;
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-muted);
}

.requester-empty-state h4 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 700;
}

.requester-empty-state p {
  margin: 0;
  color: var(--color-text-soft);
}

.requester-empty-state-inline {
  padding: 0.9rem 1rem;
}

.requester-portal-app-body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

.requester-app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: var(--color-bg);
  color: var(--color-text);
  /* O shell e um <main>, e style.css (@layer base) tem uma regra generica
     `main { width: min(100%, 70rem); margin: 0 auto; }`. 70rem = 1120px: o
     portal ficava travado nessa largura e CENTRALIZADO, com faixa vazia dos
     dois lados (720px de cada lado numa tela de 2560) e a area util espremida
     em 870px — dai os chips de KPI quebrando em duas linhas e o cabecalho da
     tabela cortando "Ultima atualizacao".
     Declaracao normal basta: esta regra vive na layer `overrides`, posterior a
     `base`, entao vence sem precisar de prioridade forcada. */
  width: 100%;
  max-width: none;
  margin: 0;
}

.requester-app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 12px 18px;
  background: #0f1b2d;
  color: #f8fafc;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.requester-app-logo {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 0 18px 2px;
  text-decoration: none;
}

.requester-app-logo img {
  width: 132px;
  max-height: 40px;
  object-fit: contain;
}

.requester-app-sidebar-heading {
  display: grid;
  gap: 0.3rem;
  margin: 22px 18px 20px;
}

.requester-app-sidebar-heading strong {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.requester-app-sidebar-heading span {
  color: rgba(226, 232, 240, 0.76);
  font-size: 0.92rem;
}

.requester-app-nav {
  display: grid;
  gap: 0.42rem;
}

.requester-app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  color: rgba(241, 245, 249, 0.9);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.requester-app-nav-item i {
  width: 20px;
  color: rgba(191, 219, 254, 0.88);
  font-size: 1.05rem;
  text-align: center;
}

.requester-app-nav-item:hover,
.requester-app-nav-item:focus,
.requester-app-nav-item.is-active,
.requester-app-collapse:hover,
.requester-app-collapse:focus-visible {
  background: #1a2b46;
  color: #ffffff;
  transform: translateX(1px);
}

.requester-app-nav-item.is-active {
  box-shadow: inset 3px 0 0 #2563eb;
}

.requester-app-help-card {
  display: grid;
  gap: 0.85rem;
  margin-top: auto;
  padding: 17px;
  border-radius: 10px;
  background: #172640;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.requester-app-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #dbeafe;
  font-size: 1.05rem;
}

.requester-app-help-card strong {
  color: #ffffff;
  font-size: 0.98rem;
}

.requester-app-help-card p {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.91rem;
  line-height: 1.55;
}

.requester-app-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.requester-app-help-button:hover,
.requester-app-help-button:focus {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
  transform: translateY(-1px);
}

.requester-app-collapse {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 15px;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: transparent;
  color: rgba(226, 232, 240, 0.84);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s ease;
}

.requester-app-collapse i {
  transition: transform 0.18s ease;
}

.requester-app-shell.is-menu-collapsed .requester-app-collapse i {
  transform: rotate(180deg);
}

/* Menu recolhido. Só vale acima de 1180px, largura em que a sidebar ainda
   mostra os rótulos: abaixo disso ela já vira trilho — e, no mobile, barra
   horizontal — pelas media queries adiante. Como a classe tem especificidade
   maior que o seletor dentro daquelas media queries, sem este limite o estado
   recolhido atropelaria os dois layouts. */
@media (min-width: 1181px) {
  .requester-app-shell.is-menu-collapsed {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .is-menu-collapsed .requester-app-logo {
    justify-content: center;
    padding-inline: 0;
  }

  .is-menu-collapsed .requester-app-logo img {
    width: 56px;
  }

  .is-menu-collapsed .requester-app-sidebar-heading,
  .is-menu-collapsed .requester-app-nav-item span,
  .is-menu-collapsed .requester-app-help-card,
  .is-menu-collapsed .requester-app-collapse span {
    display: none;
  }

  .is-menu-collapsed .requester-app-nav-item,
  .is-menu-collapsed .requester-app-collapse {
    justify-content: center;
  }
}

.requester-app-main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 28px;
}

.requester-app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 88px;
  padding: 0 32px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(14px);
}

.requester-app-header h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.28rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.requester-app-header p {
  margin: 0.24rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.requester-app-account {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  color: var(--color-text);
}

.requester-app-account-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-soft);
  transition:
    background-color 0.18s ease,
    color 0.18s ease;
}

.requester-app-account-dropdown {
  position: relative;
}

.requester-app-account-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.requester-app-account-dropdown summary::-webkit-details-marker {
  display: none;
}

.requester-app-account-menu:hover,
.requester-app-account-menu:focus {
  background: var(--color-primary-soft);
  color: #2563eb;
}

.requester-app-account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 0.25rem;
  min-width: 190px;
  padding: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-lg);
}

.requester-app-account-popover a,
.requester-app-account-popover button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-soft);
  text-align: left;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 750;
}

.requester-app-account-popover a:hover,
.requester-app-account-popover a:focus,
.requester-app-account-popover button:hover,
.requester-app-account-popover button:focus {
  background: var(--color-primary-soft);
  color: #1d4ed8;
}

.requester-app-account-dropdown:not([open]) .requester-app-account-popover {
  display: none;
}

.requester-app-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #b7d0ff;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 800;
}

.requester-app-account-copy {
  display: grid;
  gap: 0.15rem;
}

.requester-app-account-copy strong {
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 850;
}

.requester-app-account-copy span {
  color: var(--color-text-soft);
  font-size: 0.88rem;
}

.requester-kpi-grid,
.requester-ticket-panel,
.requester-knowledge-card {
  width: min(100%, 1202px);
  margin-inline: auto;
}

.requester-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 32px 20px;
}

.requester-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 92px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.requester-kpi-card:hover,
.requester-kpi-card:focus,
.requester-kpi-card.is-active {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 22px 46px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.requester-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 1.2rem;
}

.requester-kpi-icon.is-blue {
  background: var(--color-primary-soft);
  color: #2563eb;
}

.requester-kpi-icon.is-green {
  background: #ecfdf3;
  color: #15803d;
}

.requester-kpi-icon.is-orange {
  background: #fff7ed;
  color: #d97706;
}

.requester-kpi-icon.is-slate {
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
}

.requester-kpi-copy {
  display: grid;
  gap: 0.18rem;
}

.requester-kpi-copy small {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.requester-kpi-copy strong {
  color: var(--color-text);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
}

.requester-kpi-copy em {
  color: var(--color-text-soft);
  font-size: 0.8rem;
  font-style: normal;
}

.requester-ticket-panel {
  padding: 20px 22px 18px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
}

.requester-ticket-panel-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 18px;
}

.requester-ticket-panel-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.requester-ticket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.requester-ticket-search {
  position: relative;
  flex: 1 1 520px;
  max-width: 560px;
  margin: 0;
}

.requester-ticket-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.requester-ticket-search input,
.requester-ticket-filter {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  font-size: 0.88rem;
  outline: 0;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.requester-ticket-search input {
  padding: 0 1rem 0 42px;
}

.requester-ticket-filter {
  flex: 0 0 154px;
  padding: 0 0.9rem;
}

.requester-ticket-search input:focus,
.requester-ticket-filter:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.requester-ticket-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.requester-ticket-new-button:hover,
.requester-ticket-new-button:focus {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.24);
  transform: translateY(-1px);
}

.requester-ticket-table {
  display: grid;
  gap: 0;
}

.requester-ticket-table-head,
.requester-ticket-row {
  display: grid;
  grid-template-columns: 168px minmax(300px, 1fr) 210px 198px 30px;
  align-items: center;
  gap: 16px;
}

.requester-ticket-table-head {
  min-height: 36px;
  padding: 0 12px;
  color: var(--color-text-soft);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

.requester-ticket-list {
  display: grid;
}

.requester-ticket-row {
  width: 100%;
  min-height: 58px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}

.requester-ticket-row:hover,
.requester-ticket-row:focus {
  background: var(--color-surface-muted);
  transform: translateX(2px);
}

.requester-ticket-number {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 750;
}

.requester-ticket-subject {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.requester-ticket-subject strong {
  color: var(--color-text);
  font-size: 0.93rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requester-ticket-subject small,
.requester-ticket-updated {
  color: var(--color-text-soft);
  font-size: 0.82rem;
}

.requester-ticket-status {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  width: fit-content;
  min-height: 28px;
  padding: 0.24rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.requester-ticket-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.requester-ticket-status.is-open {
  background: #eaf8f0;
  color: #15803d;
}

.requester-ticket-status.is-waiting {
  background: #fff3e3;
  color: #c2410c;
}

.requester-ticket-status.is-closed {
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
}

.requester-ticket-open-icon {
  justify-self: end;
  color: var(--color-text-muted);
}

.requester-ticket-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 10px 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.requester-ticket-pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.requester-ticket-pagination-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface-solid);
  color: var(--color-text-soft);
  font-weight: 750;
}

.requester-ticket-pagination-actions button:hover:not(:disabled),
.requester-ticket-pagination-actions button:focus:not(:disabled),
.requester-ticket-pagination-actions button.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.requester-ticket-pagination-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.requester-empty-state-table {
  margin-top: 16px;
}

.requester-knowledge-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
}

.requester-knowledge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #f1ebff;
  color: #6d28d9;
  font-size: 1.25rem;
}

.requester-knowledge-card h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 850;
}

.requester-knowledge-card p {
  margin: 0.22rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

/* ---- Meu perfil (/portal/perfil) ---- */

.requester-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px 32px 28px;
}

.requester-profile-panel {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
}

.requester-profile-panel-head {
  margin-bottom: 18px;
}

.requester-profile-panel-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 850;
}

.requester-profile-panel-head p {
  margin: 0.28rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.requester-profile-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 14px;
}

.requester-profile-field span {
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.requester-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 20px;
}

.requester-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-primary-soft);
  background-size: cover;
  background-position: center;
  color: var(--color-primary-text);
  font-size: 1.4rem;
  font-weight: 800;
}

/* Com foto, as iniciais sairiam por cima da imagem. */
.requester-profile-avatar.has-photo span {
  display: none;
}

.requester-profile-avatar-actions {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
  min-width: 0;
}

.requester-profile-avatar-actions small {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.requester-profile-readonly {
  display: grid;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted);
}

.requester-profile-readonly span {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.requester-profile-readonly strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.requester-profile-readonly small {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-text-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.requester-profile-actions {
  display: flex;
  justify-content: flex-end;
}

.requester-profile-feedback {
  margin: 18px 32px 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-weight: 700;
}

.requester-profile-feedback[hidden] {
  display: none;
}

.requester-profile-feedback.is-success {
  border-color: var(--color-success);
  background: var(--color-success-soft);
  color: var(--color-success-text);
}

.requester-profile-feedback.is-error {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

@media (max-width: 1024px) {
  .requester-profile-grid {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .requester-profile-feedback {
    margin-inline: 18px;
  }
}

/* Classe, e não `.requester-knowledge-card a`: o dropdown da busca vive dentro
   deste card e cada resultado é um <a>. O seletor por elemento os transformaria
   em botão-pílula de 42px e destruiria a lista. */
.requester-knowledge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 800;
}

.requester-knowledge-link:hover,
.requester-knowledge-link:focus {
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.1);
}

/* Busca de artigos no card. Reusa o endpoint público de deflection e o dropdown
   .knowledge-search-results, iguais aos do formulário /helpdesk/abrir. */
.requester-knowledge-search {
  position: relative;
  grid-column: 1 / -1;
}

.requester-knowledge-search-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.requester-knowledge-search-field:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.requester-knowledge-search-field i {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.requester-knowledge-search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 0.94rem;
  outline: none;
}

.requester-knowledge-search-field input::-webkit-search-cancel-button {
  appearance: none;
}

@media (max-width: 1180px) {
  .requester-app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .requester-app-logo {
    justify-content: center;
    padding-inline: 0;
  }

  .requester-app-logo img {
    width: 56px;
  }

  .requester-app-sidebar-heading,
  .requester-app-nav-item span,
  .requester-app-help-card,
  .requester-app-collapse span {
    display: none;
  }

  .requester-app-nav-item,
  .requester-app-collapse {
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .requester-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requester-ticket-panel-head,
  .requester-ticket-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .requester-ticket-search,
  .requester-ticket-filter {
    max-width: none;
    flex: 1 1 auto;
  }

  .requester-ticket-table-head,
  .requester-ticket-row {
    grid-template-columns: 120px minmax(180px, 1fr) 160px 160px 26px;
  }
}

@media (max-width: 760px) {
  .requester-app-shell {
    grid-template-columns: 1fr;
  }

  .requester-app-sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }

  .requester-app-logo img {
    width: 124px;
  }

  .requester-app-sidebar-heading,
  .requester-app-nav-item span,
  .requester-app-help-card {
    display: grid;
  }

  /* Aqui a sidebar é uma barra horizontal no topo: não há o que recolher. */
  .requester-app-collapse {
    display: none;
  }

  .requester-app-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requester-app-main {
    height: auto;
    overflow: visible;
  }

  .requester-app-header {
    position: relative;
    min-height: auto;
    padding: 22px 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .requester-kpi-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .requester-ticket-panel,
  .requester-knowledge-card {
    width: calc(100% - 36px);
  }

  .requester-ticket-table-head {
    display: none;
  }

  .requester-ticket-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    min-height: auto;
    padding: 16px 0;
  }

  .requester-ticket-open-icon {
    display: none;
  }

  .requester-ticket-pagination,
  .requester-knowledge-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.public-richtext-shell.is-disabled {
  opacity: 0.72;
}

.is-low {
  color: #2563eb;
}

.is-medium {
  color: #ca8a04;
}

.is-high {
  color: #ea580c;
}

.is-critical {
  color: #dc2626;
}

@media (max-width: 1100px) {
  .requester-auth-shell,
  .requester-ticket-create,
  .requester-ticket-detail-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .requester-portal-shell,
  .requester-auth-shell {
    width: min(100vw - 24px, 1200px);
  }

  .requester-portal-topbar,
  .requester-portal-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .requester-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .requester-ticket-row,
  .requester-ticket-row-meta,
  .requester-ticket-row-meta {
    align-items: flex-start;
    justify-items: start;
  }

  .requester-ticket-row {
    flex-direction: column;
  }
}

.dashboard-profile-summary {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem 0.55rem;
}

.dashboard-profile-summary-label {
  color: rgba(148, 163, 184, 0.82);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-profile-summary strong {
  color: #f8fafc;
  font-size: 0.92rem;
  line-height: 1.15;
}

.dashboard-profile-summary small {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.72rem;
}

#profile-anchor .dropdown-divider {
  border-color: rgba(148, 163, 184, 0.16);
  margin: 0.35rem 0;
}

#profile-anchor .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.35rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  color: #e2e8f0;
  font-weight: 600;
}

#profile-anchor .dropdown-item i {
  width: 1rem;
  text-align: center;
  color: rgba(191, 219, 254, 0.88);
}

#profile-anchor .dropdown-item:hover,
#profile-anchor .dropdown-item:focus {
  background: rgba(37, 99, 235, 0.16);
  color: #ffffff;
}

#profile-anchor li a:hover,
#profile-anchor li a:focus {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #ffffff !important;
}

#profile-anchor .dashboard-logout-item {
  color: #fecaca;
}

#profile-anchor .dashboard-logout-item i {
  color: #fda4af;
}

#profile-anchor .dashboard-logout-item:hover,
#profile-anchor .dashboard-logout-item:focus {
  background: rgba(190, 24, 93, 0.16);
  color: #fff1f2;
}

.dashboard-footer {
  position: relative;
  flex: 0 0 auto;
  padding: 0 1.25rem 1rem;
}

.container-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.footer-brand-mark img {
  width: 1.7rem;
  height: 1.7rem;
  object-fit: contain;
}

.footer-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.footer-brand-copy strong {
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-brand-copy span,
.container-footer p {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.78rem;
}

:root[data-theme-mode="dark"] #dash .admin-entity-card,
:root[data-theme-mode="dark"] #dash .import-stepper-item,
:root[data-theme-mode="dark"] #dash .import-guide-card,
:root[data-theme-mode="dark"] #dash .import-guide-item,
:root[data-theme-mode="dark"] #dash .import-empty-panel,
:root[data-theme-mode="dark"] #dash .upload-preview-card,
:root[data-theme-mode="dark"] #dash .location-admin-card,
:root[data-theme-mode="dark"] #dash .company-group-item > div.bg-white,
:root[data-theme-mode="dark"] #dash .catalog-admin-item > div.bg-white,
:root[data-theme-mode="dark"] #dash .company-group-item > .border.rounded-3.p-3.h-100.bg-white,
:root[data-theme-mode="dark"] #dash #catalog-admin-list .catalog-admin-item > div,
:root[data-theme-mode="dark"] #dash .overview-location-card,
:root[data-theme-mode="dark"] #dash .overview-incident-item,
:root[data-theme-mode="dark"] #dash .overview-stat-card,
:root[data-theme-mode="dark"] #dash .overview-category-card,
:root[data-theme-mode="dark"] #dash .overview-surface {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88)) !important;
  background-color: #0f172a !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24);
}

:root[data-theme-mode="dark"] #dash .catalog-admin-panel {
  border-color: rgba(51, 65, 85, 0.84) !important;
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.36) !important;
}

:root[data-theme-mode="dark"] #dash .catalog-admin-panel-head-light {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9)) !important;
  border-bottom-color: rgba(51, 65, 85, 0.78) !important;
}

/* Empresas/Grupos: o painel .admin-card (Nova empresa, Empresas cadastradas,
   criar grupo, lista de grupos) usa gradiente claro hardcoded na base — no
   escuro vira moldura navy (espelha o tratamento de .admin-entity-card acima).
   Gradiente de 2 paradas não cabe num único token flipante. */
:root[data-theme-mode="dark"] #dash .admin-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88));
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] #dash .admin-summary-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.92)) !important;
  border-color: rgba(51, 65, 85, 0.78) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24) !important;
}

:root[data-theme-mode="dark"] #dash .admin-summary-copy span,
:root[data-theme-mode="dark"] #dash .admin-summary-copy small {
  color: var(--theme-text-muted) !important;
}

:root[data-theme-mode="dark"] #dash .admin-summary-copy strong {
  color: var(--theme-text) !important;
}


:root[data-theme-mode="dark"] #dash .catalog-admin-form .form-label,
:root[data-theme-mode="dark"] #dash #catalog-list-title {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .catalog-admin-form .form-control,
:root[data-theme-mode="dark"] #dash .catalog-admin-form .form-select,
:root[data-theme-mode="dark"] #dash #catalog-search,
:root[data-theme-mode="dark"] #dash #catalog-scope-filter,
:root[data-theme-mode="dark"] #dash #catalog-brand-filter {
  background: rgba(15, 23, 42, 0.9) !important;
  color: var(--theme-text) !important;
  border-color: rgba(71, 85, 105, 0.7) !important;
}

:root[data-theme-mode="dark"] #dash .catalog-admin-item > div {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9)) !important;
  border-color: rgba(51, 65, 85, 0.78) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24) !important;
}

:root[data-theme-mode="dark"] #dash .catalog-admin-item .card-title,
:root[data-theme-mode="dark"] #dash .catalog-admin-item h5,
:root[data-theme-mode="dark"] #dash .catalog-admin-item h6,
:root[data-theme-mode="dark"] #dash .catalog-admin-item strong {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .catalog-admin-item .btn-outline-danger {
  background: rgba(127, 29, 29, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.36) !important;
  color: #fca5a5 !important;
}

:root[data-theme-mode="dark"] #dash #catalog-empty-state {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88)) !important;
  color: var(--theme-text-muted) !important;
  border-color: rgba(51, 65, 85, 0.72) !important;
}

/* Catalogo (Marcas/Modelos/Operadoras): a barra .catalog-toolbar tem
   gradiente branco hardcoded na base (@layer pages) — no escuro virava barra
   branca. Migra a superficie e a borda pra tokens flipantes; as tabs, busca e
   dropdown internos ja usam tokens (--color-surface-muted/-solid/-border). */
:root[data-theme-mode="dark"] #dash .catalog-toolbar {
  background: var(--color-surface-solid);
  border-color: var(--color-border);
}

:root[data-theme-mode="dark"] #dash .overview-location-card.has-issues,
:root[data-theme-mode="dark"] #dash .overview-location-card.is-healthy,
:root[data-theme-mode="dark"] #dash .overview-incident-item.is-acknowledged {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.92)) !important;
}


/* Thumbnails de IMAGEM/LOGO mantêm placa clara no escuro (logos coloridos
   precisam de fundo claro pra contrastar). NÃO incluir aqui os ícones-glyph
   FA (.admin-entity-icon, .device-type-icon-preview, .device-type-icon-option):
   o glyph usa color (var(--theme-text), claro no escuro) → ficaria claro sobre
   placa clara, invisível. Esses ganham placa escura logo abaixo. */
:root[data-theme-mode="dark"] #dash .admin-entity-logo,
:root[data-theme-mode="dark"] #dash .monitoring-model-thumb,
:root[data-theme-mode="dark"] #dash .overview-location-brand,
:root[data-theme-mode="dark"] #dash .overview-incident-icon,
:root[data-theme-mode="dark"] #dash .upload-preview-card-readonly img,
:root[data-theme-mode="dark"] #dash #appearance-logo-preview .upload-preview-card img,
:root[data-theme-mode="dark"] #dash #appearance-favicon-preview .upload-preview-card img {
  background: var(--custom-thumbnail-bg, #eef4fb) !important;
  color: var(--theme-text) !important;
  border-color: rgba(226, 232, 240, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 18px rgba(2, 6, 23, 0.24);
}

/* Ícones-glyph FA + pílulas de preview de ícone: placa ESCURA com glyph/label
   claros (legíveis no escuro). Fix do ícone do agente de monitoramento e do
   preview/opções de ícone de tipo de dispositivo que apareciam claro-no-claro. */
:root[data-theme-mode="dark"] #dash .admin-entity-icon,
:root[data-theme-mode="dark"] #dash .device-type-icon-preview,
:root[data-theme-mode="dark"] #dash .device-type-icon-option {
  background: var(--color-surface-muted) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
  box-shadow: none;
}

:root[data-theme-mode="dark"] #dash .device-type-icon-preview i,
:root[data-theme-mode="dark"] #dash .device-type-icon-preview span,
:root[data-theme-mode="dark"] #dash .device-type-icon-option i,
:root[data-theme-mode="dark"] #dash .device-type-icon-option span,
:root[data-theme-mode="dark"] #dash .admin-entity-icon i {
  color: var(--color-text);
}

:root[data-theme-mode="dark"] #dash .monitoring-model-thumb img,
:root[data-theme-mode="dark"] #dash .overview-location-brand img,
:root[data-theme-mode="dark"] #dash .overview-incident-icon img {
  background: transparent !important;
  object-fit: contain;
  padding: 0.32rem;
}

:root[data-theme-mode="dark"] .status-offline {
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.3), rgba(225, 29, 72, 0.26));
  color: #fecdd3;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.18);
}


:root[data-theme-mode="dark"] #dash .admin-entity-copy h3,
:root[data-theme-mode="dark"] #dash .generic-device-card-name,
:root[data-theme-mode="dark"] #dash .admin-info-value,
:root[data-theme-mode="dark"] #dash .overview-location-head h4,
:root[data-theme-mode="dark"] #dash .overview-location-rate,
:root[data-theme-mode="dark"] #dash .overview-section-header h3,
:root[data-theme-mode="dark"] #dash .overview-incident-line strong,
:root[data-theme-mode="dark"] #dash .import-guide-card,
:root[data-theme-mode="dark"] #dash .import-stepper-item strong {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-copy p,
:root[data-theme-mode="dark"] #dash .location-admin-card .text-muted,
:root[data-theme-mode="dark"] #dash .location-admin-card .text-secondary,
:root[data-theme-mode="dark"] #dash .company-group-item .text-muted,
:root[data-theme-mode="dark"] #dash .catalog-admin-item .text-muted,
:root[data-theme-mode="dark"] #dash .company-group-item .fw-semibold,
:root[data-theme-mode="dark"] #dash .company-group-item strong,
:root[data-theme-mode="dark"] #dash .catalog-admin-item .fw-semibold,
:root[data-theme-mode="dark"] #dash .catalog-admin-item strong,
:root[data-theme-mode="dark"] #dash .generic-device-card-location,
:root[data-theme-mode="dark"] #dash .admin-info-label,
:root[data-theme-mode="dark"] #dash .import-guide-item span,
:root[data-theme-mode="dark"] #dash .import-stepper-item div:last-child,
:root[data-theme-mode="dark"] #dash .import-empty-panel,
:root[data-theme-mode="dark"] #dash .overview-section-header p,
:root[data-theme-mode="dark"] #dash .overview-location-head p,
:root[data-theme-mode="dark"] #dash .overview-incident-meta,
:root[data-theme-mode="dark"] #dash .overview-incident-subline,
:root[data-theme-mode="dark"] #dash .overview-incident-detail-line,
:root[data-theme-mode="dark"] #dash .overview-stat-label,
:root[data-theme-mode="dark"] #dash .overview-category-head p,
:root[data-theme-mode="dark"] #dash .upload-preview-card figcaption,
:root[data-theme-mode="dark"] #dash .settings-hint {
  color: var(--theme-text-muted) !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-note-text,
:root[data-theme-mode="dark"] #dash .monitoring-attendance-note-text {
  color: rgba(226, 232, 240, 0.82) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-card,
:root[data-theme-mode="dark"] #dash .generic-device-toolbar-shell,
:root[data-theme-mode="dark"] #dash .generic-device-fact {
  background: rgba(15, 23, 42, 0.78) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.24);
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-card.is-success {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.82), rgba(4, 120, 87, 0.7)) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-card.is-danger {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.82), rgba(136, 19, 55, 0.74)) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-card.is-muted {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(51, 65, 85, 0.74)) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-copy strong,
:root[data-theme-mode="dark"] #dash .generic-device-toolbar-head h5,
:root[data-theme-mode="dark"] #dash .generic-device-fact strong,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill,
:root[data-theme-mode="dark"] #dash .generic-device-page-eyebrow {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-copy small,
:root[data-theme-mode="dark"] #dash .generic-device-summary-copy span,
:root[data-theme-mode="dark"] #dash .generic-device-toolbar-head p,
:root[data-theme-mode="dark"] #dash .generic-device-toolbar-count,
:root[data-theme-mode="dark"] #dash .generic-device-filter-field span,
:root[data-theme-mode="dark"] #dash .generic-device-fact span {
  color: var(--theme-text-muted) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-summary-icon,
:root[data-theme-mode="dark"] #dash .generic-device-toolbar-count,
:root[data-theme-mode="dark"] #dash .generic-device-chip,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-mode {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #bfdbfe !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-active,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill.is-success {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #a7f3d0 !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-target,
:root[data-theme-mode="dark"] #dash .generic-device-chip.is-muted,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill.is-muted {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-context.is-danger,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill.is-danger {
  background: rgba(244, 63, 94, 0.18) !important;
  color: #fecdd3 !important;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.16);
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-context.is-warning,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill.is-warning {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fde68a !important;
}

:root[data-theme-mode="dark"] #dash .generic-device-chip.is-context.is-unstable,
:root[data-theme-mode="dark"] #dash .generic-device-state-pill.is-unstable {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .appearance-advanced-panel {
  background: rgba(15, 23, 42, 0.46) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
}

:root[data-theme-mode="dark"] #dash .appearance-advanced-summary strong {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .appearance-advanced-summary > span:last-child {
  color: var(--theme-text-muted) !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-status {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.26), rgba(190, 24, 93, 0.18)) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(251, 113, 133, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 14px rgba(136, 19, 55, 0.24);
  text-shadow: 0 0 10px rgba(251, 113, 133, 0.16);
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority {
  background:
    linear-gradient(180deg, rgba(31, 12, 18, 0.96), rgba(24, 11, 16, 0.92)) !important;
  border-color: rgba(248, 113, 113, 0.2) !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-unstable {
  background:
    linear-gradient(180deg, rgba(35, 24, 59, 0.96), rgba(25, 18, 46, 0.92)) !important;
  border-color: rgba(167, 139, 250, 0.22) !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-toolbar {
  background: rgba(69, 10, 10, 0.34) !important;
  border: 1px solid rgba(248, 113, 113, 0.12);
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-caption,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-page,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-count,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-section-header p,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-detail-line,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-subline,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-line span {
  color: #fca5a5 !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-section-header h3,
:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-line strong {
  color: #fff1f2 !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged) {
  background: linear-gradient(180deg, rgba(60, 15, 23, 0.94), rgba(44, 14, 20, 0.9)) !important;
  border-left-color: rgba(248, 113, 113, 0.92) !important;
  box-shadow: 0 4px 14px rgba(190, 24, 93, 0.2);
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-item-alert:not(.is-acknowledged)::before {
  background: linear-gradient(180deg, #ef4444, #fb7185) !important;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.08);
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-icon {
  background: rgba(127, 29, 29, 0.52) !important;
  color: #fecaca !important;
  border-color: rgba(248, 113, 113, 0.18) !important;
  box-shadow: 0 4px 12px rgba(127, 29, 29, 0.24) !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incident-status {
  background: linear-gradient(90deg, #b91c1c, #ef4444) !important;
  color: #fff7f7 !important;
  border-color: rgba(254, 202, 202, 0.12) !important;
  text-shadow: none;
}

:root[data-theme-mode="dark"] #dash .overview-alert-pill.is-offline {
  background: linear-gradient(90deg, #b91c1c, #ef4444) !important;
  color: #fff7f7 !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.22) !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-pager .btn {
  background: rgba(15, 23, 42, 0.42) !important;
  border-color: rgba(248, 113, 113, 0.22) !important;
  color: #fca5a5 !important;
}

:root[data-theme-mode="dark"] #dash .overview-surface-priority .overview-incidents-pager .btn:hover:not(:disabled) {
  background: rgba(127, 29, 29, 0.36) !important;
  color: #fff1f2 !important;
}

:root[data-theme-mode="dark"] #dash .overview-alert-pill.is-unstable {
  background: rgba(139, 92, 246, 0.24) !important;
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-item.is-unstable {
  background: linear-gradient(180deg, rgba(46, 16, 101, 0.3), rgba(30, 27, 75, 0.28)) !important;
  border-left-color: rgba(167, 139, 250, 0.92) !important;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.16);
}

:root[data-theme-mode="dark"] #dash .overview-incident-status.is-attending {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-status.is-unstable {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #ddd6fe !important;
  border-color: rgba(196, 181, 253, 0.18) !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-metric.is-offline {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fda4af !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-metric.is-attending {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-metric.is-unstable {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .overview-incident-metric.is-neutral {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-ticket-badge {
  background: rgba(59, 130, 246, 0.22) !important;
  color: #bfdbfe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-status-meta {
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-status-meta.is-offline {
  background: rgba(127, 29, 29, 0.28) !important;
  color: #fda4af !important;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.16) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-status-meta.is-secondary {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-ack-context {
  background: rgba(15, 23, 42, 0.54) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-ack-timeline-label {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item {
  background: rgba(15, 23, 42, 0.42) !important;
  border-color: rgba(51, 65, 85, 0.92) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item strong {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item span {
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-offline {
  background: rgba(69, 10, 10, 0.34) !important;
  border-color: rgba(248, 113, 113, 0.18) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-offline strong,
:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-offline span {
  color: #fda4af !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-attending {
  background: rgba(120, 53, 15, 0.28) !important;
  border-color: rgba(251, 191, 36, 0.16) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-attending strong,
:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-attending span {
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-unstable {
  background: rgba(76, 29, 149, 0.32) !important;
  border-color: rgba(167, 139, 250, 0.18) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-unstable strong,
:root[data-theme-mode="dark"] #dash .monitoring-timeline-item.is-unstable span {
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip {
  background: rgba(15, 23, 42, 0.54) !important;
  border-color: rgba(51, 65, 85, 0.82) !important;
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip strong {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip.is-offline {
  background: rgba(69, 10, 10, 0.34) !important;
  border-color: rgba(248, 113, 113, 0.18) !important;
  color: #fda4af !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip.is-attending {
  background: rgba(120, 53, 15, 0.28) !important;
  border-color: rgba(251, 191, 36, 0.16) !important;
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip.is-unstable {
  background: rgba(76, 29, 149, 0.28) !important;
  border-color: rgba(167, 139, 250, 0.18) !important;
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-history-chip.is-neutral {
  background: rgba(30, 41, 59, 0.64) !important;
  border-color: rgba(100, 116, 139, 0.18) !important;
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] .location-group-logo,
:root[data-theme-mode="dark"] .swal2-popup .location-group-logo {
  background: var(--custom-thumbnail-bg, #eef4fb) !important;
  border-color: rgba(226, 232, 240, 0.18) !important;
}

:root[data-theme-mode="dark"] #dash .btn-outline-primary,
:root[data-theme-mode="dark"] #dash .edit-location-btn,
:root[data-theme-mode="dark"] #dash .edit-company-group-btn,
:root[data-theme-mode="dark"] #dash .company-group-item .btn-outline-primary {
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.42) !important;
  background: rgba(37, 99, 235, 0.12) !important;
}

:root[data-theme-mode="dark"] #dash .btn-outline-primary:hover,
:root[data-theme-mode="dark"] #dash .edit-location-btn:hover,
:root[data-theme-mode="dark"] #dash .edit-company-group-btn:hover,
:root[data-theme-mode="dark"] #dash .company-group-item .btn-outline-primary:hover {
  color: #eff6ff !important;
  border-color: rgba(96, 165, 250, 0.62) !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(59, 130, 246, 0.24)) !important;
}

:root[data-theme-mode="dark"] #dash .btn-outline-danger,
:root[data-theme-mode="dark"] #dash .delete-location-btn,
:root[data-theme-mode="dark"] #dash .delete-company-group-btn,
:root[data-theme-mode="dark"] #dash .delete-catalog-btn,
:root[data-theme-mode="dark"] #dash .company-group-item .btn-outline-danger {
  color: #fda4af !important;
  border-color: rgba(244, 63, 94, 0.38) !important;
  background: rgba(127, 29, 29, 0.16) !important;
}

:root[data-theme-mode="dark"] #dash .btn-outline-danger:hover,
:root[data-theme-mode="dark"] #dash .delete-location-btn:hover,
:root[data-theme-mode="dark"] #dash .delete-company-group-btn:hover,
:root[data-theme-mode="dark"] #dash .delete-catalog-btn:hover,
:root[data-theme-mode="dark"] #dash .company-group-item .btn-outline-danger:hover {
  color: #fff1f2 !important;
  border-color: rgba(251, 113, 133, 0.55) !important;
  background: linear-gradient(135deg, rgba(190, 24, 93, 0.3), rgba(127, 29, 29, 0.22)) !important;
}

:root[data-theme-mode="dark"] #dash .btn-warning,
:root[data-theme-mode="dark"] #dash .edit-catalog-btn,
:root[data-theme-mode="dark"] #dash .catalog-admin-item .btn-warning {
  color: #fef3c7 !important;
  border-color: rgba(245, 158, 11, 0.36) !important;
  background: rgba(146, 64, 14, 0.22) !important;
}

:root[data-theme-mode="dark"] #dash .btn-warning:hover,
:root[data-theme-mode="dark"] #dash .edit-catalog-btn:hover,
:root[data-theme-mode="dark"] #dash .catalog-admin-item .btn-warning:hover {
  color: #fffbeb !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.34), rgba(217, 119, 6, 0.24)) !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-badge,
:root[data-theme-mode="dark"] #dash .overview-location-metrics span,
:root[data-theme-mode="dark"] #dash .import-guide-badge.is-optional {
  background: rgba(148, 163, 184, 0.12) !important;
  color: var(--theme-chip-text) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-badge.is-primary {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #bfdbfe !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-badge.is-success {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #a7f3d0 !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-badge.is-warning {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fde68a !important;
}

:root[data-theme-mode="dark"] #dash .admin-entity-badge.is-muted {
  background: rgba(100, 116, 139, 0.22) !important;
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] #dash .admin-info-row,
:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody td,
:root[data-theme-mode="dark"] #dash .monitoring-data-table thead th {
  border-color: rgba(51, 65, 85, 0.92) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.28) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody tr.monitoring-unified-row.is-offline {
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.5), rgba(15, 23, 42, 0.88)) !important;
  box-shadow: inset 4px 0 0 #f87171 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody tr.monitoring-unified-row.is-attending {
  background: linear-gradient(90deg, rgba(69, 26, 3, 0.44), rgba(15, 23, 42, 0.88)) !important;
  box-shadow: inset 4px 0 0 #fbbf24 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody tr.monitoring-unified-row.is-unstable {
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.34), rgba(15, 23, 42, 0.88)) !important;
  box-shadow: inset 4px 0 0 #60a5fa !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-table-wrap,
:root[data-theme-mode="dark"] #dash .monitoring-data-table {
  background: transparent !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.84)) !important;
  border-color: rgba(51, 65, 85, 0.88) !important;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card[data-monitoring-summary-card]:hover {
  box-shadow: 0 18px 30px rgba(2, 6, 23, 0.34) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card[data-monitoring-summary-card].is-active {
  border-color: rgba(96, 165, 250, 0.48) !important;
  box-shadow: 0 18px 32px rgba(30, 64, 175, 0.2) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card[data-monitoring-summary-card].is-active .monitoring-summary-icon {
  background: rgba(30, 64, 175, 0.3) !important;
  color: #dbeafe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-icon {
  background: rgba(30, 41, 59, 0.92) !important;
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-copy span,
:root[data-theme-mode="dark"] #dash .monitoring-summary-copy small {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-copy strong {
  color: #f8fafc !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-offline .monitoring-summary-icon {
  background: rgba(69, 10, 10, 0.42) !important;
  color: #fda4af !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-offline .monitoring-summary-copy strong {
  color: #fda4af !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-attending .monitoring-summary-icon {
  background: rgba(120, 53, 15, 0.34) !important;
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-attending .monitoring-summary-copy strong {
  color: #fcd34d !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-unstable .monitoring-summary-icon {
  background: rgba(76, 29, 149, 0.34) !important;
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-summary-card.is-unstable .monitoring-summary-copy strong {
  color: #ddd6fe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-data-table tbody td,
:root[data-theme-mode="dark"] #dash .monitoring-data-table thead th,
:root[data-theme-mode="dark"] #dash .monitoring-table-primary,
:root[data-theme-mode="dark"] #dash .monitoring-table-secondary,
:root[data-theme-mode="dark"] #dash .monitoring-model-cell,
:root[data-theme-mode="dark"] #dash .monitoring-attendance-meta,
:root[data-theme-mode="dark"] #dash .monitoring-attendance-chip,
:root[data-theme-mode="dark"] #dash .monitoring-status-stack {
  color: var(--theme-text) !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-unified-priority-hint.is-offline {
  background: rgba(127, 29, 29, 0.4) !important;
  color: #fecaca !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-unified-priority-hint.is-attending {
  background: rgba(120, 53, 15, 0.42) !important;
  color: #fde68a !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-unified-priority-hint.is-unstable {
  background: rgba(30, 64, 175, 0.36) !important;
  color: #bfdbfe !important;
}

:root[data-theme-mode="dark"] #dash .monitoring-mode-chip {
  background: rgba(30, 41, 59, 0.82) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

:root[data-theme-mode="dark"] #dash .monitoring-mode-chip.is-mode {
  background: rgba(30, 64, 175, 0.24) !important;
  color: #bfdbfe !important;
  border-color: rgba(59, 130, 246, 0.28);
}

:root[data-theme-mode="dark"] #dash .monitoring-mode-chip.is-target {
  background: rgba(15, 23, 42, 0.74) !important;
  color: #cbd5e1 !important;
  border-color: rgba(51, 65, 85, 0.72);
}

:root[data-theme-mode="dark"] #dash .monitoring-mode-chip.is-disabled {
  background: rgba(71, 85, 105, 0.26) !important;
  color: #e2e8f0 !important;
  border-color: rgba(100, 116, 139, 0.3);
}

:root[data-theme-mode="dark"] #dash .settings-mode-option,
:root[data-theme-mode="dark"] #dash .settings-mode-option .text-muted,
:root[data-theme-mode="dark"] #dash .settings-mode-option .form-check-label {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88)) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme-mode="dark"] #dash .settings-mode-option input[type=\"radio\"] {
  accent-color: #3b82f6;
}

:root[data-theme-mode="dark"] #dash .import-guide-card table,
:root[data-theme-mode="dark"] #dash .import-guide-card tbody,
:root[data-theme-mode="dark"] #dash .import-guide-card tr,
:root[data-theme-mode="dark"] #dash .import-guide-card td,
:root[data-theme-mode="dark"] #dash .import-guide-card th {
  color: var(--theme-text) !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
}

:root[data-theme-mode="light"] .dashboard-nav {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(226, 232, 240, 0.92)),
    #e8eef7;
  border-right-color: rgba(148, 163, 184, 0.18);
  box-shadow: 18px 0 40px rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="light"] .dashboard-nav header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92)),
    #eef4fb !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

:root[data-theme-mode="light"] .brand-copy,
:root[data-theme-mode="light"] .brand-copy strong,
:root[data-theme-mode="light"] .dashboard-toolbar h1 {
  color: #0f172a !important;
  text-shadow: none;
}

:root[data-theme-mode="light"] .brand-logo img {
  filter: none;
  opacity: 0.98;
}

:root[data-theme-mode="light"] .dashboard-brand-toggle,
:root[data-theme-mode="light"] .dashboard-store-toggle,
:root[data-theme-mode="light"] #admin-nav,
:root[data-theme-mode="light"] .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle,
:root[data-theme-mode="light"] .dashboard-nav-item,
:root[data-theme-mode="light"] .dashboard-nav-dropdown-item {
  color: #334155 !important;
}

:root[data-theme-mode="light"] .dashboard-nav-dropdown-menu {
  background: rgba(255, 255, 255, 0.48);
}

:root[data-theme-mode="light"] .dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.88));
  border-color: rgba(148, 163, 184, 0.16);
}

/* Overrides do tema light pra toggles do header, NAO pros itens do sidebar.
   O sidebar segue navColor da tenant (que pode ser escuro mesmo no tema
   light); aplicar bg pale-blue + texto escuro la dentro quebra contraste
   contra fundos escuros (Bug: navColor:#0f172a + themeMode:light fazia
   texto dark slate sumir no hover). Itens do sidebar usam o default rule
   (~linha 20245) que respeita --custom-nav-hover-bg / --custom-nav-hover-text. */
:root[data-theme-mode="light"] .dashboard-brand-toggle:hover,
:root[data-theme-mode="light"] .dashboard-store-toggle:hover,
:root[data-theme-mode="light"] #admin-nav:hover,
:root[data-theme-mode="light"] .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #0f172a !important;
}

:root[data-theme-mode="light"] .dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle:not(#admin-nav),
:root[data-theme-mode="light"] .dashboard-store-group .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle,
:root[data-theme-mode="light"] #admin-nav.show,
:root[data-theme-mode="light"] .dashboard-store-group .dashboard-nav-dropdown-item.is-active,
:root[data-theme-mode="light"] .dashboard-store-group .dashboard-nav-dropdown-item[aria-current="page"],
:root[data-theme-mode="light"] .dashboard-nav-dropdown-item.is-active,
:root[data-theme-mode="light"] .dashboard-nav-dropdown-item[aria-current="page"] {
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.95), rgba(226, 232, 240, 0.9)) !important;
  color: #0f172a !important;
  border-color: rgba(96, 165, 250, 0.2) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

:root[data-theme-mode="light"] .dashboard-nav .dashboard-nav-dropdown-toggle:after {
  border-top-color: rgba(51, 65, 85, 0.56);
}

:root[data-theme-mode="light"] .container-footer {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.92)),
    #e2e8f0;
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.14);
}

:root[data-theme-mode="light"] .footer-brand-mark {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="light"] .footer-brand-copy strong,
:root[data-theme-mode="light"] .footer-brand-copy span,
:root[data-theme-mode="light"] .container-footer p {
  color: #334155 !important;
}

:root[data-theme-mode="light"] #dash .monitoring-data-table thead th {
  color: #334155 !important;
}

:root[data-theme-mode="light"] #dash .monitoring-table-secondary,
:root[data-theme-mode="light"] #dash .monitoring-attendance-meta,
:root[data-theme-mode="light"] #dash .monitoring-attendance-chip,
:root[data-theme-mode="light"] #dash .text-muted,
:root[data-theme-mode="light"] #dash small.text-muted {
  color: #64748b !important;
}

:root[data-theme-mode="light"] #dash .monitoring-ack-button,
:root[data-theme-mode="light"] #dash .badge.bg-warning,
:root[data-theme-mode="light"] #dash .badge.text-dark.bg-warning {
  color: #1f2937 !important;
}

.container-footer p {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  .dashboard-nav {
    width: min(86vw, 320px);
  }

  .dashboard-toolbar {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 767.98px) {
  .brand-copy,
  .dashboard-user-meta small,
  .dashboard-user-caret {
    display: none;
  }

  #dashboard-button {
    min-height: 48px;
    padding-right: 0.5rem;
  }

  .dashboard-user-meta strong,
  #dashboard-button span#user-name {
    max-width: 120px;
    font-size: 0.84rem;
  }

  .container-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .container-footer p {
    white-space: normal;
  }
}

body {
  background: #f3f6fb;
}

.dashboard {
  min-height: 100vh;
  height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.dashboard-nav {
  width: 216px;
  min-width: 216px;
}

.dashboard-nav header {
  min-height: 60px;
  padding: 0.7rem 0.8rem;
}

.brand-logo img {
  max-width: 68px;
  max-height: 28px;
}

.brand-copy strong {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.brand-copy small {
  font-size: 0.6rem;
  opacity: 0.82;
}

.dashboard-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: calc(100% - 216px);
  height: 100vh;
  min-height: 100vh;
  margin-left: 216px;
  margin-top: 0;
  overflow: hidden;
}

.dashboard-toolbar {
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  z-index: 20;
  min-height: 60px;
  padding: 0.72rem 1.05rem;
  margin: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.dashboard-toolbar h1 {
  letter-spacing: 0.14em;
  font-size: 1rem;
}

#dashboard-button {
  min-height: 50px;
  padding: 0.35rem 0.65rem 0.35rem 0.4rem;
  border-radius: 16px;
}

.dashboard-user-avatar-shell {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 14px;
}

#dashboard-button .avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
}

.dashboard-user-meta strong,
#dashboard-button span#user-name {
  font-size: 0.86rem;
}

.dashboard-user-meta small {
  font-size: 0.7rem;
}

.dashboard-content {
  overflow: hidden;
  padding: 0.85rem 1rem 0;
  background-color: transparent;
  background-image: none;
}

#dash {
  padding: 0;
  overflow-y: auto;
  padding-bottom: 0.65rem;
}

#dash > :first-child {
  margin-top: 0;
}

.dashboard-footer {
  padding: 0.45rem 1rem 0.8rem;
}

.container-footer {
  min-height: 46px;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--custom-footer-bg, #232833);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.footer-brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  background: rgba(255, 255, 255, 0.08);
}

.footer-brand-mark img {
  width: 1.55rem;
  height: 1.55rem;
}

.footer-brand-copy strong {
  color: #f8fafc;
  font-size: 0.82rem;
}

.footer-brand-copy span,
.container-footer p {
  color: rgba(226, 232, 240, 0.68);
  font-size: 0.7rem;
}

.dashboard-nav-list {
  padding: 0.6rem 0.5rem 0.8rem;
}

.dashboard-nav-item,
.dashboard-nav-dropdown-item {
  min-height: 2.38rem;
  padding: 0.58rem 0.68rem;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-nav-dropdown-menu {
  margin-left: 0.22rem;
  padding-left: 0.45rem;
}

.dashboard-nav-item i,
.dashboard-nav-dropdown-item i {
  width: 0.9rem;
  font-size: 0.86rem;
}

#admin-nav {
  margin-top: 0.2rem;
}

@media (min-width: 992px) {
  .dashboard-toolbar {
    left: auto !important;
  }

  .dashboard-compact .dashboard-app {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  .dashboard-app {
    width: 100%;
    margin-left: 0;
  }

  .dashboard-content {
    padding: 0.9rem 0.9rem 0;
  }

  .dashboard-footer {
    padding: 0.65rem 0.9rem 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .dashboard-toolbar {
    min-height: 64px;
    padding: 0.8rem 0.9rem;
  }

  .dashboard-content {
    padding: 0.75rem 0.75rem 0;
  }

  .container-footer {
    align-items: flex-start;
  }
}

.dashboard-nav {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(15, 23, 42, 0.08)),
    #17181f;
  box-shadow: 18px 0 40px rgba(2, 6, 23, 0.16);
}

.dashboard-nav header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    #1d222b !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  justify-content: center;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.brand-logo {
  gap: 0.7rem;
  width: auto;
  padding: 0.18rem 0.3rem;
  border-radius: 12px;
}

.brand-copy {
  color: #f8fafc;
  display: flex;
  align-items: center;
}

.brand-copy strong {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  line-height: 1;
  color: #f8fafc;
  text-shadow: 0 1px 12px rgba(15, 23, 42, 0.24);
}

.brand-copy small {
  display: none;
}

.brand-logo img {
  opacity: 0.96;
  filter: brightness(1.08) saturate(0.95);
}

.brand-logo:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dashboard-nav-list {
  padding-top: 0.7rem;
}

.dashboard-brand-group,
.dashboard-store-group,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown {
  margin-bottom: 0.28rem;
}

.dashboard-brand-toggle,
.dashboard-store-toggle,
#admin-nav,
.dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle {
  min-height: 2.34rem;
  padding: 0.58rem 0.78rem;
  border-radius: 12px;
  color: var(--custom-nav-text, rgba(226, 232, 240, 0.88));
  font-size: 0.77rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dashboard-brand-toggle:hover,
.dashboard-store-toggle:hover,
.dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover,
#admin-nav:hover {
  background: var(--custom-nav-hover-bg, rgba(255, 255, 255, 0.075));
  border-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(1px);
}

.dashboard-location-label {
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: inherit;
  line-height: 1.2;
}

.dashboard-brand-mark,
.menu-icon-image-large,
.location-group-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-left: 0;
  border-radius: 999px;
  padding: 0.22rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: none;
}

.dashboard-brand-mark {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.dashboard-brand-mark img,
.menu-icon-image-large,
.location-group-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.location-group-logo.is-empty {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.7);
}

.dashboard-store-group .dashboard-nav-item {
  min-height: 2.5rem;
}

.dashboard-brand-toggle i,
.dashboard-store-toggle i,
.dashboard-nav-item i {
  color: currentColor;
}

.dashboard-nav-dropdown-menu {
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  margin-top: 0.2rem;
  overflow: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle {
  background: linear-gradient(135deg, var(--custom-nav-hover-bg, rgba(59, 130, 246, 0.16)), rgba(255, 255, 255, 0.06));
  border-color: rgba(96, 165, 250, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.dashboard-nav-dropdown.show > .dashboard-nav-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-brand-group .dashboard-nav-dropdown-menu,
.dashboard-store-group .dashboard-nav-dropdown-menu {
  margin-top: 0.3rem;
  margin-left: 0.35rem;
  padding: 0.35rem 0.35rem 0.4rem 0.55rem;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(15, 23, 42, 0.04));
  border-radius: 0 14px 14px 0;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu {
  margin-top: 0.32rem;
  margin-left: 0.35rem;
  padding: 0.38rem 0.35rem 0.42rem 0.55rem;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(15, 23, 42, 0.045));
  border-radius: 0 14px 14px 0;
}

.dashboard-nav-dropdown-item {
  min-height: 2rem;
  padding: 0.4rem 0.62rem;
  color: var(--custom-nav-text, rgba(203, 213, 225, 0.82));
  font-size: 0.71rem;
  font-weight: 550;
  position: relative;
  border-radius: 8px;
  letter-spacing: 0.005em;
}

.dashboard-nav-dropdown-item:hover {
  background: var(--custom-nav-hover-bg, rgba(255, 255, 255, 0.06));
  color: #ffffff;
  transform: none;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu > .dashboard-nav-dropdown,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu > .dashboard-nav-dropdown-item {
  margin-bottom: 0.08rem;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu .dashboard-nav-dropdown-toggle,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu > .dashboard-nav-dropdown-item {
  min-height: 2.08rem;
  padding: 0.42rem 0.68rem;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 600;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu .dashboard-nav-dropdown-toggle:hover,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu > .dashboard-nav-dropdown-item:hover {
  background: var(--custom-nav-hover-bg, rgba(255, 255, 255, 0.055));
  color: #ffffff;
}

.dashboard-nav-dropdown-item::before {
  display: none;
}

.dashboard-store-group .dashboard-nav-dropdown-item {
  padding-left: 0.7rem !important;
}

.dashboard-store-group .dashboard-nav-dropdown-item.is-active,
.dashboard-store-group .dashboard-nav-dropdown-item[aria-current="page"] {
  background: linear-gradient(135deg, var(--custom-nav-hover-bg, rgba(59, 130, 246, 0.18)), rgba(255, 255, 255, 0.06));
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.dashboard-store-group .dashboard-nav-dropdown-menu .dashboard-nav-dropdown-item + .dashboard-nav-dropdown-item {
  margin-top: 0.12rem;
}

.dashboard-store-group .dashboard-nav-dropdown-toggle,
.dashboard-brand-group .dashboard-nav-dropdown-toggle {
  box-shadow: none;
}

.dashboard-store-group .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle {
  background: linear-gradient(135deg, var(--custom-nav-hover-bg, rgba(59, 130, 246, 0.14)), rgba(255, 255, 255, 0.04));
  border-color: rgba(96, 165, 250, 0.14);
  color: #ffffff;
}

.dashboard-store-group .dashboard-nav-item i,
.dashboard-brand-group .dashboard-nav-item i {
  opacity: 0.9;
}

.dashboard-store-group .dashboard-nav-dropdown {
  margin-bottom: 0.22rem;
}

#admin-nav {
  margin-top: 0.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(15, 23, 42, 0.04)),
    rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: none;
  color: var(--custom-nav-text, #f8fafc);
}

#admin-nav i {
  margin-left: 0;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown:last-child {
  margin-top: auto;
  padding-top: 0.55rem;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown:last-child::before {
  content: "";
  display: block;
  height: 1px;
  margin: 0 0.45rem 0.55rem;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0));
}

.dashboard-nav .dashboard-nav-dropdown-toggle:after {
  border-top-color: rgba(226, 232, 240, 0.58);
  opacity: 0.9;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle:not(#admin-nav) {
  background: var(--custom-nav-hover-bg, rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown:last-child .dashboard-nav-dropdown-item,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown:last-child .dashboard-nav-dropdown-toggle {
  color: var(--custom-nav-text, rgba(226, 232, 240, 0.84));
}

.dashboard-compact .dashboard-toolbar {
  padding-left: 1.1rem;
}

.dashboard-toolbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #1b1d25;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-toolbar-start {
  gap: 0.8rem;
}

.dashboard-toolbar h1 {
  color: #f8fafc;
  text-shadow: none;
}

.menu-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: rgba(248, 250, 252, 0.88);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

#dashboard-button {
  gap: 0.7rem;
  border-color: rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(15, 23, 42, 0.04)),
    #6f7b86;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
  transition: transform 0.18s ease, box-shadow 0.22s ease, background-color 0.18s ease, border-color 0.18s ease;
}

#dashboard-button:hover,
#dashboard-button:focus,
#dashboard-button.show {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.16);
}

.dashboard-user-avatar-shell {
  background: rgba(255, 255, 255, 0.18);
}

.dashboard-user-meta strong,
#dashboard-button span#user-name {
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.dashboard-user-meta small {
  color: rgba(241, 245, 249, 0.72);
  font-size: 0.68rem;
}

.dashboard-user-caret {
  font-size: 0.72rem;
}

.dashboard-nav-item,
.dashboard-nav-dropdown-item,
.dashboard-brand-toggle,
.dashboard-store-toggle,
#admin-nav,
.dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle {
  padding-left: 0.78rem !important;
  padding-right: 0.78rem !important;
}

.dashboard-nav-item i,
.dashboard-brand-toggle i,
.dashboard-store-toggle i,
#admin-nav i {
  margin-left: 0 !important;
}

.dashboard-toolbar {
  min-height: 58px;
  align-items: center;
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
}

.dashboard-toolbar-start {
  min-height: 40px;
  align-self: center;
}

.dashboard-toolbar-copy {
  min-height: 40px;
}

.dashboard-toolbar-title-fixed,
.dashboard-toolbar h1 {
  display: block;
  min-height: auto;
  line-height: 1;
}

.dashboard-toolbar > .dropdown {
  display: flex;
  align-items: center;
  align-self: center;
  margin: 0;
  height: 100%;
}

#dashboard-button {
  min-height: 42px;
  height: 42px;
  padding: 0.25rem 0.6rem 0.25rem 0.35rem;
  align-self: center;
  margin: 0;
  line-height: 1;
  position: relative;
  top: 0;
  bottom: 0;
}

#dashboard-button.dropdown-toggle::after {
  display: none;
}

.dashboard-user-avatar-shell {
  width: 2rem;
  height: 2rem;
}

#dashboard-button .avatar {
  width: 1.75rem;
  height: 1.75rem;
}

.dashboard-user-meta strong,
#dashboard-button span#user-name {
  font-size: 0.82rem;
}

.dashboard-user-meta small {
  font-size: 0.66rem;
}

.menu-toggle {
  width: 34px;
  height: 34px;
  align-self: center;
}

.dashboard-toolbar {
  min-height: 56px;
  padding: 0.35rem 1rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-toolbar-start {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 34px;
}

.dashboard-toolbar-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.1rem;
}

.dashboard-toolbar-eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.52);
  line-height: 1;
}

.dashboard-toolbar-title-fixed,
.dashboard-toolbar h1,
.dashboard-toolbar .dropdown {
  align-self: center;
  margin: 0;
}

.dashboard-toolbar > .dropdown {
  margin-left: auto;
  flex: 0 0 auto;
}

.dashboard-toolbar-title-fixed,
.dashboard-toolbar h1 {
  min-height: auto;
  line-height: 1.05;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  line-height: 1;
}

#dashboard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  height: 40px;
  margin: 0;
  padding: 0.28rem 0.68rem 0.28rem 0.38rem;
  line-height: 1;
  transform: none !important;
}

#dashboard-button .dashboard-user-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.dashboard-user-caret {
  margin-left: 0.12rem;
  opacity: 0.86;
}

.dashboard-toolbar > .dropdown-menu,
#profile-anchor.dropdown-menu {
  margin-top: 0.55rem !important;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    #182133;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transform-origin: top right;
  visibility: hidden;
  pointer-events: none;
  display: block;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.22s;
}

.dashboard-toolbar > .dropdown-menu.show,
#profile-anchor.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

#profile-anchor .dropdown-item,
#profile-anchor li a {
  color: #e5edf7 !important;
  border-radius: 14px;
}

#profile-anchor .dropdown-item:hover,
#profile-anchor .dropdown-item:focus,
#profile-anchor li a:hover,
#profile-anchor li a:focus {
  background: rgba(95, 129, 173, 0.18) !important;
  color: #ffffff !important;
}

.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu {
  padding: 0.32rem 0.36rem 0.4rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dashboard-store-group .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle,
#admin-nav.show,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle:not(#admin-nav) {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 12px 24px rgba(15, 23, 42, 0.14);
}

.dashboard-nav-dropdown-item,
.dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu .dashboard-nav-dropdown-toggle {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.dashboard-nav-dropdown-item[aria-current="page"],
.dashboard-nav-dropdown-item.is-active {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(255, 255, 255, 0.04));
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.14);
}

.dashboard-nav-dropdown-item-featured {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(59, 130, 246, 0.1));
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.22);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.dashboard-nav-dropdown-item-featured:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(59, 130, 246, 0.16));
  color: #ffffff;
}

.swal2-popup {
  transform-origin: center;
  animation: modal-pop-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

/* O desfoque e do DIALOGO. O container do toast tambem ganha
   `.swal2-backdrop-show`, entao herdava o blur e borrava a faixa de 360px atras
   do aviso -- o texto da tela ficava ilegivel ali durante os 3 segundos. Mesma
   exclusao usada no veu, em netzor-swal.css. */
.swal2-backdrop-show:not(:has(.swal2-toast)) {
  backdrop-filter: blur(8px);
}

/* Anima SO opacity. Antes animava tambem transform e filter: blur() -- e
   `filter` cria stacking context E bloco de contencao para descendentes
   position:fixed/absolute. Durante os 320ms o subtree inteiro era rasterizado
   com outra referencia de posicionamento e "estalava" de volta ao fim da
   animacao: a piscada em que se via a estrutura crua ao criar/editar/excluir.
   Mesma licao de nao animar transform em elemento que o JS posiciona. */
@keyframes dash-surface-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-nav,
  .dashboard-nav-dropdown-menu,
  .dashboard-nav-item,
  .dashboard-nav-dropdown-item,
  .overview-stat-card,
  .overview-category-card,
  .overview-surface,
  .overview-location-card,
  .overview-incident-item,
  #dashboard-button,
  .menu-toggle,
  #profile-anchor.dropdown-menu,
  .swal2-popup,
  #dash > *.dash-motion-enter {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

.footer-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
}

.footer-brand-mark img {
  max-width: 1.45rem;
  max-height: 1.45rem;
}

.container-footer .footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0.3rem;
}

.container-footer .footer-brand-mark img,
.container-footer #footer-brand-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0;
}

.swal-wide-modal {
  width: min(1120px, calc(100vw - 2rem)) !important;
}

.app-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.app-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
}

/* Era `#334155` fixo: cinza-escuro sobre o fundo escuro do modal dava 1.6:1 —
   o rotulo do campo praticamente sumia no tema escuro. `--color-text` e nao
   `--color-text-soft` porque o soft devolvia so 4.69:1 no claro (o fixo dava
   ~8.5:1): trocar um tema quebrado por outro sem margem nao e conserto. A
   hierarquia com o valor do campo continua vindo do peso e do tamanho. */
.app-modal-form label > span,
.app-modal-form .helpdesk-editor-shell > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
}

.app-modal-form-grid {
  display: grid;
  gap: 0.9rem;
}

.app-modal-form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-modal-form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-modal-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem !important;
}

.app-modal-checkbox input {
  margin: 0;
}

.admin-info-grid {
  display: grid;
  gap: 0.7rem;
}

.admin-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-info-row span {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.admin-info-row strong {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
}

.admin-entity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inventory-workspace,
.helpdesk-workspace,
.remote-support-workspace {
  width: 100%;
}

@media (min-width: 1200px) {
  .helpdesk-workspace {
    zoom: 0.88;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .helpdesk-workspace {
    zoom: 0.94;
  }
}

.inventory-toolbar-shell,
.helpdesk-filter-shell {
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.inventory-filter-grid-simple,
.helpdesk-filter-grid,
.remote-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.inventory-grid,
/* Container das sessões: bloco vertical (grid de ativos + histórico recolhido). */
.remote-session-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.remote-session-active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.inventory-card .admin-entity-body {
  gap: 0.85rem;
}

.inventory-attachment-shell {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.76);
}

.inventory-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.inventory-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 0.8rem;
}

.inventory-attachment-empty {
  color: #64748b;
  font-size: 0.84rem;
}

.helpdesk-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.helpdesk-column {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-height: 420px;
}

.helpdesk-column-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
  }

.helpdesk-column-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.helpdesk-column-head p {
    margin: 0.18rem 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.35;
  }

.helpdesk-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    height: 2.1rem;
    padding: 0 0.9rem;
    border-radius: 0.45rem;
    background: #5b7181;
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

.helpdesk-column-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.helpdesk-ticket-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.helpdesk-ticket-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.helpdesk-ticket-number {
  display: inline-flex;
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.helpdesk-ticket-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.helpdesk-ticket-origin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
}

.helpdesk-ticket-origin.is-public { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.helpdesk-ticket-origin.is-internal { background: rgba(16, 185, 129, 0.14); color: #047857; }
.helpdesk-ticket-origin.is-email { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.helpdesk-ticket-stack {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-top: 0.85rem;
}

.helpdesk-ticket-stack span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #475569;
  font-size: 0.83rem;
}

.helpdesk-ticket-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.helpdesk-ticket-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.helpdesk-ticket-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}

.helpdesk-ticket-chip.is-assigned {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.helpdesk-ticket-updated {
  display: block;
  margin-top: 0.85rem;
  color: #64748b;
  font-size: 0.76rem;
}

.helpdesk-admin-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.helpdesk-admin-section {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.helpdesk-admin-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.helpdesk-admin-section-head h3 {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  color: #0f172a;
}

.helpdesk-admin-section-head p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.84rem;
}

.helpdesk-admin-eyebrow {
  display: inline-flex;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.helpdesk-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.helpdesk-admin-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.helpdesk-admin-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.helpdesk-admin-item-main strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.helpdesk-admin-item-main small {
  color: #64748b;
  font-size: 0.8rem;
}

.helpdesk-admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.helpdesk-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
}

.helpdesk-admin-badge.is-success {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.helpdesk-admin-badge.is-muted {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.helpdesk-admin-badge.is-terminal {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.helpdesk-admin-color-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.24);
}

.helpdesk-color-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.helpdesk-color-field-shell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.helpdesk-color-picker {
  width: 52px;
  min-width: 52px;
  height: 44px;
  padding: 0.18rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-solid);
  cursor: pointer;
}

.helpdesk-color-text {
  flex: 1;
}

.helpdesk-admin-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.helpdesk-status-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.helpdesk-status-column {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.helpdesk-status-column-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.helpdesk-status-column-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.helpdesk-status-column-copy h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
}

.helpdesk-status-column-copy p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
}

.helpdesk-status-column-meta {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.helpdesk-status-empty {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.62);
}

.helpdesk-status-empty strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.helpdesk-status-empty small {
  color: #64748b;
  font-size: 0.8rem;
}

.helpdesk-admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.72);
}

.helpdesk-detail-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.helpdesk-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.helpdesk-detail-card,
.helpdesk-detail-thread {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.72);
  padding: 1rem;
}

.helpdesk-detail-eyebrow {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.helpdesk-detail-card h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
}

.helpdesk-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.helpdesk-detail-list span {
  color: #475569;
  font-size: 0.9rem;
}

.helpdesk-detail-actions {
  display: flex;
  justify-content: end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.helpdesk-detail-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.helpdesk-detail-thread-head strong {
  color: #0f172a;
}

.helpdesk-detail-thread-head small {
  color: #64748b;
}

.helpdesk-message-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.helpdesk-message-item {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.helpdesk-message-item.is-internal {
  background: var(--color-surface-muted);
}

.helpdesk-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.6rem;
}

.helpdesk-message-meta strong {
  color: #0f172a;
}

.helpdesk-message-meta span,
.helpdesk-message-meta time {
  color: #64748b;
  font-size: 0.78rem;
}

.helpdesk-message-body {
  color: #334155;
  line-height: 1.55;
}

.helpdesk-message-body p:last-child {
  margin-bottom: 0;
}

.helpdesk-message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.helpdesk-message-files a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.helpdesk-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.helpdesk-editor-toolbar,
.public-richtext-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.public-richtext-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.helpdesk-editor-toolbar button,
.public-richtext-toolbar button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text-soft);
}

.helpdesk-editor-surface,
.public-richtext-editor {
  min-height: 180px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  line-height: 1.55;
}

.public-richtext-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.remote-support-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.remote-support-hero {
  overflow: hidden;
}

.remote-support-hero .dash-toolbar-actions {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-left: 1rem;
  background: transparent;
}

.remote-support-hero .dash-toolbar-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.remote-support-filter-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

.remote-support-filter-shell .remote-quick-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.remote-support-filter-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(180px, 240px);
  align-items: end;
}

.remote-support-search-field {
  min-width: 0;
}

#remote-search {
  min-width: min(620px, 100%);
}

.remote-settings-card {
  padding: 1.1rem;
  border-radius: 24px;
}

.remote-settings-collapse {
  padding: 0.4rem 0.45rem 0.55rem;
}

.remote-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.7rem;
  border-radius: 18px;
}

.remote-settings-summary::-webkit-details-marker {
  display: none;
}

.remote-settings-summary strong {
  display: block;
  color: #0f172a;
  font-size: 0.95rem;
}

.remote-settings-summary span {
  display: block;
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.81rem;
}

.remote-settings-summary i {
  color: #475569;
  transition: transform 0.18s ease;
}

.remote-settings-collapse[open] .remote-settings-summary i {
  transform: rotate(180deg);
}

.remote-settings-body {
  padding: 0.75rem 0.5rem 0.2rem;
}

.remote-settings-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.remote-settings-head h3 {
  margin: 0;
  color: #0f172a;
}

.remote-settings-head p {
  margin: 0.25rem 0 0;
  color: #64748b;
}

.remote-settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.remote-settings-health {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.95rem;
  background: var(--color-surface-muted);
}

.remote-settings-health.is-ready {
  border-color: rgba(16, 185, 129, 0.28);
  background: var(--color-success-soft);
}

.remote-settings-health-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.remote-settings-health-head strong {
  color: var(--color-text);
}

.remote-settings-health-head span {
  color: var(--color-text-soft);
  font-size: 0.92rem;
}

.remote-settings-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem 1rem;
}

.remote-settings-checklist span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-text-soft);
}

.remote-settings-checklist span.is-done {
  color: #047857;
}

.remote-settings-checklist em {
  font-style: normal;
}

.remote-server-health {
  margin-top: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--color-surface-muted);
}

.remote-server-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.remote-server-health-msg {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-soft);
}

.remote-server-health.is-ok { background: var(--color-success-soft); }
.remote-server-health.is-ok .remote-server-health-badge { color: var(--color-success-text); }
.remote-server-health.is-warn { background: var(--color-warning-soft); }
.remote-server-health.is-warn .remote-server-health-badge { color: var(--color-warning-text); }
.remote-server-health.is-danger { background: var(--color-danger-soft); }
.remote-server-health.is-danger .remote-server-health-badge { color: var(--color-danger-text); }
.remote-server-health.is-neutral .remote-server-health-badge { color: var(--color-text-soft); }

.remote-settings-editor {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.95rem;
}

.remote-settings-editor small {
  color: #64748b;
}

.remote-settings-hint {
  margin-top: 0.95rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.38);
  background: var(--color-surface-muted);
}

.remote-settings-hint strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--color-text);
}

.remote-settings-hint ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--color-text-soft);
}

.remote-settings-toggle {
  margin-top: 0.9rem !important;
}

/* ===== Acesso remoto: onboarding, subtela de config e histórico (PR3) ===== */
.remote-onboarding {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
}

.remote-onboarding-copy {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.remote-onboarding-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 14px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.remote-onboarding.is-pending .remote-onboarding-icon {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.remote-onboarding-copy strong {
  display: block;
  color: var(--color-text);
  font-size: 1.02rem;
}

.remote-onboarding-copy p {
  margin: 0.2rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.remote-onboarding-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remote-onboarding-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-muted);
}

.remote-onboarding-steps strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.remote-onboarding-steps span {
  color: var(--color-text-soft);
  font-size: 0.82rem;
}

.remote-onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.remote-settings-cards {
  display: grid;
  gap: 1rem;
}

.remote-settings-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
}

.remote-settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.remote-settings-block-head h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.05rem;
}

.remote-settings-block-head p {
  margin: 0.25rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.88rem;
}

.remote-settings-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.remote-settings-status {
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
}

.remote-settings-status.is-ready {
  background: var(--color-success-soft);
  color: var(--color-success-text);
}

.remote-settings-status.is-pending {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.remote-settings-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding: 1.1rem 1.2rem;
  list-style: none;
}

.remote-settings-advanced-summary::-webkit-details-marker {
  display: none;
}

.remote-settings-advanced-summary:hover {
  background: var(--color-surface-muted);
}

.remote-settings-advanced-summary strong {
  display: block;
  color: var(--color-text);
}

.remote-settings-advanced-summary span {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

.remote-settings-advanced-summary i {
  color: var(--color-text-muted);
  transition: transform 0.18s ease;
}

.remote-settings-advanced[open] .remote-settings-advanced-summary i {
  transform: rotate(180deg);
}

.remote-settings-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1.2rem 1.15rem;
}

/* KPIs viram filtros clicáveis */
.admin-summary-card.is-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.admin-summary-card.is-clickable:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
}

/* Histórico de sessões (recolhido) */
.remote-session-history {
  padding: 0;
}

.remote-session-history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}

.remote-session-history-summary::-webkit-details-marker {
  display: none;
}

.remote-session-history-summary i {
  color: var(--color-text-muted);
  transition: transform 0.18s ease;
}

.remote-session-history[open] .remote-session-history-summary i {
  transform: rotate(180deg);
}

.remote-session-history-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border-subtle);
}

.remote-session-history-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.remote-session-history-row:last-child {
  border-bottom: 0;
}

.remote-session-history-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.remote-session-history-copy strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.remote-session-history-copy span {
  color: var(--color-text-soft);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-session-history-row > small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.remote-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.remote-session-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.remote-session-links a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.remote-launch-button.is-ready-launch {
  position: relative;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.24);
}

.remote-launch-button.is-ready-launch::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(34, 197, 94, 0.28);
  animation: remoteReadyPulse 1.8s ease-out infinite;
  pointer-events: none;
}

.remote-session-next-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-top: 0.7rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.remote-session-next-step.is-info {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.remote-session-next-step.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.remote-session-next-step.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.remote-session-next-step.is-muted {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.remote-session-return-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.92);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}

.remote-session-note-preview {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.45;
}

.remote-session-updated {
  color: #64748b;
  font-size: 0.76rem;
}

.remote-session-portal-return {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.96), rgba(240, 249, 255, 0.94));
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #1e3a8a;
}

.remote-session-portal-return span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
}

.remote-session-portal-return strong {
  color: #334155;
  font-size: 0.84rem;
}

.remote-session-portal-return p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.remote-session-ready-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.18);
  color: #166534;
  font-size: 0.86rem;
  font-weight: 700;
}

.remote-session-ready-banner.is-progress {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.remote-session-workspace {
  min-height: 0;
}

.remote-session-detail-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 1.15rem;
}

.remote-session-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.08);
}

.remote-session-side-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.remote-session-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.08);
}

.remote-session-notes-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.remote-session-side .helpdesk-detail-eyebrow,
.remote-session-main .helpdesk-detail-thread-head strong {
  letter-spacing: 0.08em;
}

.remote-session-side h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.remote-session-side .helpdesk-detail-list {
  gap: 0.6rem;
  padding-top: 0.1rem;
}

.remote-session-side .helpdesk-detail-list span {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.remote-session-side .helpdesk-detail-list span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.remote-session-main .helpdesk-detail-thread-head {
  margin-bottom: 0.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.remote-session-main .app-modal-form-grid {
  gap: 0.9rem;
}

.remote-session-main .form-control,
.remote-session-main .form-select {
  min-height: 46px;
}

.remote-session-main textarea.form-control {
  min-height: 220px;
  resize: vertical;
}

.remote-session-side-actions .btn,
.remote-session-main .helpdesk-detail-thread-head .btn,
.remote-support-hero .helpdesk-hero-actions .btn {
  min-height: 42px;
  border-radius: 14px;
}

.remote-session-side-actions .btn:hover,
.remote-session-side-actions .btn:focus,
.remote-session-side-actions .btn:active {
  color: #fff !important;
}

.remote-support-hero .helpdesk-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.remote-support-hero .helpdesk-hero-actions #remote-session-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 220px;
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #f8fafc !important;
}

.remote-support-hero .helpdesk-hero-actions #remote-session-back:hover,
.remote-support-hero .helpdesk-hero-actions #remote-session-back:focus,
.remote-support-hero .helpdesk-hero-actions #remote-session-back:active {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #f8fafc !important;
}

.remote-support-hero .helpdesk-hero-actions #remote-session-cancel {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.remote-support-hero .helpdesk-hero-actions #remote-session-cancel:hover,
.remote-support-hero .helpdesk-hero-actions #remote-session-cancel:focus,
.remote-support-hero .helpdesk-hero-actions #remote-session-cancel:active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.remote-support-hero .helpdesk-hero-actions #remote-session-open-rustdesk {
  min-width: 220px;
}

@keyframes remoteReadyPulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}


.inventory-report-grid,
.inventory-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.inventory-breakdown-grid {
  margin-top: 1rem;
}

.inventory-report-section {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.inventory-report-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
}

.inventory-report-head p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.83rem;
}

.inventory-report-list,
.inventory-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inventory-report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.82rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
}

.inventory-report-item strong {
  color: #0f172a;
}

.inventory-report-item small {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.78rem;
}

.inventory-report-item span {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.public-tool-page {
  min-height: 100vh;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 24%),
    linear-gradient(180deg, #eef4fb, #f8fafc);
}

.public-tool-shell {
  width: min(1180px, calc(100vw - 2rem));
  min-height: 100vh;
  height: auto;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  gap: 1.25rem;
  align-items: center;
  padding: 2rem 0;
}

.helpdesk-public-shell {
  grid-template-columns: 1fr;
  align-items: start;
}

.remote-support-public-shell {
  gap: 2rem;
  grid-template-columns: 1fr;
  align-items: start;
  align-content: start;
  width: min(980px, calc(100vw - 2rem));
  min-height: auto;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.remote-support-public-shell .public-tool-showcase,
.remote-support-public-shell .public-tool-card {
  width: 100%;
}

.remote-support-public-shell .public-tool-showcase {
  padding: 1.25rem 1.5rem;
}

.remote-support-public-shell .public-tool-showcase h1 {
  line-height: 1.02;
}

.remote-support-public-shell .public-tool-showcase p {
  max-width: none;
}

.public-tool-showcase,
.public-tool-card {
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.08);
}

.public-tool-showcase {
  position: relative;
  padding: 1.1rem 1.6rem 1.4rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.22), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.14), transparent 38%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92)),
    #0b1426;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 28px 60px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.public-tool-showcase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.public-tool-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.public-tool-brand-logo {
  max-height: 42px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.35));
}

.public-tool-brand-fallback {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.92);
  text-transform: uppercase;
}

.public-tool-showcase-copy {
  max-width: 38rem;
}

.public-tool-login-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.public-tool-login-link:hover,
.public-tool-login-link:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
  outline: none;
}

.public-tool-list a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.public-tool-list a:hover,
.public-tool-list a:focus-visible {
  color: #bfdbfe;
}

.public-tool-eyebrow {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.26rem 0.65rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.public-tool-showcase h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  line-height: 1.08;
}

.public-tool-showcase p {
  margin: 0.45rem 0 0;
  max-width: 44rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.92rem;
  line-height: 1.55;
}

.public-tool-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.public-tool-list-icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 0.9rem;
}

.helpdesk-public-shell .public-tool-list {
  margin-top: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.remote-support-context-list {
  margin: 1rem 0 1.2rem;
}

.remote-support-context-list div {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.remote-support-context-list strong {
  color: var(--color-text);
}

.remote-support-context-list span {
  color: var(--color-text-soft);
}

.helpdesk-public-shell .public-tool-list > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(2px);
}

.helpdesk-public-shell .public-tool-list > div > div {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

.public-tool-list strong {
  color: #f8fafc;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.public-tool-list span {
  color: rgba(226, 232, 240, 0.74);
  font-size: 0.88rem;
  line-height: 1.5;
}

.public-tool-card {
  padding: 1.45rem;
  background: rgba(255, 255, 255, 0.96);
}

.public-tool-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.public-tool-card-head h2 {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-size: 1.55rem;
}

.public-tool-card-head p {
  margin: 0;
  max-width: 30ch;
  color: #64748b;
}

.public-tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 700;
}

.public-tool-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.public-form-grid {
  display: grid;
  gap: 0.9rem;
}

.public-form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Linha do solicitante: Nome / E-mail / Empresa / Categoria.
   Nome e E-mail recebem 1.5fr (campos de texto livre, precisam de
   espaco); Empresa e Categoria 1fr (selects com label curto). */
.public-form-grid-requester {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
}

/* Linha de meta do ticket: Servico / Prioridade / Assunto.
   Assunto recebe 2x do servico (1.4fr 1fr 2fr). */
/* Duas colunas (Servico | Assunto) desde que Prioridade saiu do formulario
   publico; com tres a faixa da terceira ficava vazia. */
.public-form-grid-ticket-meta {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
}

@media (max-width: 1100px) {
  .public-form-grid-requester {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .public-form-grid-3,
  .public-form-grid-ticket-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .public-form-grid-ticket-meta__subject {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .public-form-grid-3,
  .public-form-grid-requester,
  .public-form-grid-ticket-meta {
    grid-template-columns: 1fr;
  }
  .public-form-grid-ticket-meta__subject {
    grid-column: auto;
  }
}

/* Elegant select overlay (desktop): mantem <select> nativo escondido
   como source-of-truth; expoe button + panel estilizados por cima. */
.ds-elegant-select {
  position: relative;
  width: 100%;
}

.ds-elegant-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.ds-elegant-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  background: var(--color-surface-solid, #fff);
  cursor: pointer;
  text-align: left;
}

.ds-elegant-select-trigger:focus {
  border-color: rgba(51, 135, 255, 0.72);
  box-shadow: var(--nz-intensity-light-focus, 0 0 0 3px rgba(51, 135, 255, 0.18));
  outline: 0;
}

.ds-elegant-select-trigger > i {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  transition: transform 0.18s ease;
}

.ds-elegant-select.is-open .ds-elegant-select-trigger > i {
  transform: rotate(180deg);
}

.ds-elegant-select-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  font-size: 0.92rem;
}

.ds-elegant-select-label.is-placeholder {
  color: var(--color-text-muted);
}

.ds-elegant-select-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1080;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  scrollbar-width: thin;
}

.ds-elegant-select-panel::-webkit-scrollbar {
  width: 6px;
}

.ds-elegant-select-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.ds-elegant-select-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.ds-elegant-select-item:hover,
.ds-elegant-select-item:focus-visible {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  outline: none;
}

.ds-elegant-select-item.is-selected {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  font-weight: 600;
}

.public-tool-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.public-tool-form label > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}

.public-tool-form small {
  color: #64748b;
}

.remote-support-download-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.15rem 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.96));
  text-align: center;
}

.remote-support-download-panel strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
}

.remote-support-download-panel p {
  width: 100%;
  margin: 0.45rem 0 0;
  padding: 0.82rem 1rem;
  border-radius: 16px;
  background: rgba(219, 234, 254, 0.62);
  color: #1e3a8a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.remote-support-download-button,
.remote-support-submit-button {
  min-width: 250px;
  white-space: nowrap;
}

.remote-support-download-button {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.remote-support-public-shell .public-tool-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.35rem;
}

.remote-support-public-shell .public-tool-form {
  gap: 0.95rem;
}

.remote-support-public-shell .public-form-grid {
  gap: 0.8rem;
}

.remote-support-public-shell .public-tool-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.remote-support-public-shell .public-tool-feedback {
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
}

.remote-support-public-shell .remote-support-portal-notes {
  margin-top: 0.1rem;
}

.remote-support-portal-notes {
  padding: 0.85rem 0.95rem;
  border: 1px dashed rgba(148, 163, 184, 0.34);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
}

.remote-support-portal-notes summary {
  cursor: pointer;
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 700;
  list-style: none;
}

.remote-support-portal-notes summary::-webkit-details-marker {
  display: none;
}

.remote-support-portal-notes[open] label {
  margin-top: 0.85rem;
}

.remote-support-service-hint {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(239, 246, 255, 0.94);
}

.remote-support-service-hint strong {
  color: #1d4ed8;
  font-size: 0.92rem;
}

.remote-support-service-hint p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.remote-session-swal {
  border-radius: 28px !important;
  padding: 1.15rem 1.2rem !important;
}

.remote-session-swal .swal2-title,
.swal2-popup:has(.remote-session-created-modal) .swal2-title {
  display: none !important;
}

.remote-session-create-modal {
  gap: 1rem;
}

.remote-session-modal-head {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border-radius: 22px;
  color: #f8fafc;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.22), transparent 34%),
    linear-gradient(135deg, #0f172a, #1e293b);
  text-align: left;
}

.remote-session-modal-kicker {
  width: fit-content;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.remote-session-modal-head h3,
.remote-session-created-modal h3 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.remote-session-modal-head p,
.remote-session-created-modal p {
  margin: 0;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.96rem;
  line-height: 1.55;
}

.remote-session-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.remote-session-picker-grid label,
.remote-session-notes label {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.remote-session-picker-grid label > span,
.remote-session-notes label > span {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.remote-session-flow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.remote-session-flow-strip div {
  display: grid;
  gap: 0.28rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  text-align: left;
}

.remote-session-flow-strip i {
  color: #2563eb;
  font-size: 1rem;
}

.remote-session-flow-strip strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.remote-session-flow-strip span {
  color: var(--color-text-soft);
  font-size: 0.8rem;
  line-height: 1.35;
}

.remote-session-created-modal {
  align-items: center;
  gap: 0.9rem;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.remote-session-created-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 18px 40px rgba(13, 148, 136, 0.24);
}

.remote-session-created-modal h3 {
  color: var(--color-text);
}

.remote-session-created-modal p {
  color: var(--color-text-soft);
}

.remote-session-created-summary {
  width: 100%;
}

.remote-session-created-link {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px dashed rgba(37, 99, 235, 0.28);
  color: var(--color-text-soft);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.remote-session-created-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.remote-session-created-actions .btn {
  min-height: 2.75rem;
  border-radius: 0.9rem;
  font-weight: 800;
}

@media (max-width: 767.98px) {
  .remote-session-picker-grid,
  .remote-session-flow-strip {
    grid-template-columns: 1fr;
  }
}

.remote-support-success-state {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(236, 253, 245, 0.96));
  border: 1px solid rgba(34, 197, 94, 0.18);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.remote-support-success-state h3 {
  margin: 0.75rem 0 0.35rem;
  color: #14532d;
}

.remote-support-success-state p {
  margin: 0 0 0.9rem;
  color: #166534;
}

@media (max-width: 991.98px) {
  .remote-support-download-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .remote-support-download-button,
  .remote-support-submit-button {
    min-width: 0;
    width: 100%;
  }

  .remote-session-detail-grid {
    grid-template-columns: 1fr;
  }

  .remote-session-side {
    position: static;
  }
}

.helpdesk-service-picker {
  position: relative;
  width: 100%;
}

.helpdesk-service-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 46px;
  text-align: left;
}

.helpdesk-service-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.helpdesk-service-picker-trigger span.is-placeholder {
  color: #94a3b8;
}

.helpdesk-service-picker-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  max-height: min(28rem, 65vh);
  padding: 0.7rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.helpdesk-service-picker-search-row {
  margin-bottom: 0.65rem;
  flex: 0 0 auto;
}

.helpdesk-service-picker-tree {
  flex: 1 1 auto;
  /* min-height + max-height explicitos garantem que o overflow-y kick-in,
     independente do que o pai panel calcular como espaco disponivel */
  min-height: 0;
  max-height: 22rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: block;
  gap: 0.5rem;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
  /* Scrollbar fina mas visivel para indicar overflow */
  scrollbar-width: thin;
  scrollbar-color: var(--color-neutral-300) transparent;
}

.helpdesk-service-picker-tree::-webkit-scrollbar {
  width: 8px;
}

.helpdesk-service-picker-tree::-webkit-scrollbar-track {
  background: transparent;
}

.helpdesk-service-picker-tree::-webkit-scrollbar-thumb {
  background: var(--color-neutral-300);
  border-radius: 999px;
}

.helpdesk-service-picker-tree::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-400);
}

.helpdesk-service-picker-empty {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  color: #64748b;
  font-size: 0.84rem;
}

.helpdesk-service-branch {
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  overflow: hidden;
}

.helpdesk-service-branch summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  font-weight: 800;
  color: #475569;
  display: flex;
  align-items: center;
}

.helpdesk-service-branch summary::-webkit-details-marker {
  display: none;
}

.helpdesk-service-branch summary::before {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.72rem;
  margin-right: 0.55rem;
  color: #94a3b8;
  transition: transform 0.18s ease;
}

.helpdesk-service-branch[open] summary::before {
  transform: rotate(90deg);
}

.helpdesk-service-branch-children {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.55rem 0.55rem;
}

.helpdesk-service-leaf {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.8rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  color: #0f172a;
}

.helpdesk-service-leaf strong {
  color: inherit;
  font-size: 0.92rem;
}

.helpdesk-service-leaf small {
  color: #64748b;
  line-height: 1.35;
}

.helpdesk-service-leaf.is-selected {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(239, 246, 255, 0.96);
}

.helpdesk-service-leaf-branch {
  margin-bottom: 0.1rem;
}

/* Variante compacta do picker no formulario publico: menos padding,
   itens menores, panel mais estreito. Mantem a arvore + busca, so
   reduz visual mass. */
.helpdesk-service-picker-public .helpdesk-service-picker-panel {
  max-height: min(22rem, 55vh);
  padding: 0.5rem;
  border-radius: 14px;
}

.helpdesk-service-picker-public .helpdesk-service-picker-search-row {
  margin-bottom: 0.4rem;
}

.helpdesk-service-picker-public .helpdesk-service-picker-tree {
  max-height: 18rem;
  padding-right: 0.3rem;
}

.helpdesk-service-picker-public .helpdesk-service-branch {
  border-radius: 10px;
}

.helpdesk-service-picker-public .helpdesk-service-branch summary {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.helpdesk-service-picker-public .helpdesk-service-branch summary::before {
  margin-right: 0.4rem;
  font-size: 0.65rem;
}

.helpdesk-service-picker-public .helpdesk-service-branch-children {
  gap: 0.25rem;
  padding: 0 0.35rem 0.35rem;
}

.helpdesk-service-picker-public .helpdesk-service-leaf {
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  gap: 0.08rem;
}

.helpdesk-service-picker-public .helpdesk-service-leaf strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.helpdesk-service-picker-public .helpdesk-service-leaf small {
  font-size: 0.72rem;
  line-height: 1.25;
}

.public-tool-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.3rem;
}

.public-tool-feedback {
  font-size: 0.82rem;
  color: #64748b;
}

.public-tool-feedback[data-state="success"] {
  color: #047857;
}

.public-tool-feedback[data-state="error"] {
  color: #b91c1c;
}

.public-tool-richcopy {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
  color: #334155;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.public-tool-richcopy p:last-child {
  margin-bottom: 0;
}

:root[data-theme-mode="dark"] .inventory-toolbar-shell,

.inventory-report-item > div,
.inventory-breakdown-count {
  min-width: 0;
}

.inventory-report-item strong,
.inventory-breakdown-count {
  line-height: 1.25;
}

:root[data-theme-mode="dark"] .inventory-report-section,
:root[data-theme-mode="dark"] .inventory-report-item {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.44);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.24);
}

:root[data-theme-mode="dark"] .inventory-report-head h3,
:root[data-theme-mode="dark"] .inventory-report-item strong,
:root[data-theme-mode="dark"] .inventory-report-item span {
  color: #f8fafc;
}

:root[data-theme-mode="dark"] .inventory-report-head p,
:root[data-theme-mode="dark"] .inventory-report-item small {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-filter-shell,
:root[data-theme-mode="dark"] .helpdesk-column,
:root[data-theme-mode="dark"] .helpdesk-ticket-card,
:root[data-theme-mode="dark"] .helpdesk-admin-section,
:root[data-theme-mode="dark"] .helpdesk-admin-item,
:root[data-theme-mode="dark"] .helpdesk-detail-card,
:root[data-theme-mode="dark"] .helpdesk-detail-thread,
:root[data-theme-mode="dark"] .helpdesk-message-item,
:root[data-theme-mode="dark"] .remote-settings-card,
:root[data-theme-mode="dark"] .public-tool-card,
:root[data-theme-mode="dark"] .helpdesk-editor-surface,
:root[data-theme-mode="dark"] .public-richtext-editor,
:root[data-theme-mode="dark"] .inventory-attachment-shell {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

:root[data-theme-mode="dark"] .admin-info-row span,
:root[data-theme-mode="dark"] .helpdesk-column-head p,
:root[data-theme-mode="dark"] .helpdesk-admin-section-head p,
:root[data-theme-mode="dark"] .helpdesk-ticket-stack span,
:root[data-theme-mode="dark"] .helpdesk-ticket-updated,
:root[data-theme-mode="dark"] .helpdesk-admin-item-main small,
:root[data-theme-mode="dark"] .helpdesk-detail-list span,
:root[data-theme-mode="dark"] .helpdesk-detail-thread-head small,
:root[data-theme-mode="dark"] .helpdesk-message-meta span,
:root[data-theme-mode="dark"] .helpdesk-message-meta time,
:root[data-theme-mode="dark"] .remote-settings-head p,
:root[data-theme-mode="dark"] .public-tool-card-head p,
:root[data-theme-mode="dark"] .public-tool-form label > span,
:root[data-theme-mode="dark"] .public-tool-form small,
:root[data-theme-mode="dark"] .public-tool-feedback {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] .remote-support-context-list div,
:root[data-theme-mode="dark"] .remote-support-portal-notes {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme-mode="dark"] .remote-settings-summary strong,
:root[data-theme-mode="dark"] .remote-support-context-list strong,
:root[data-theme-mode="dark"] .remote-support-portal-notes summary {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .remote-settings-summary span,
:root[data-theme-mode="dark"] .remote-support-context-list span {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .remote-session-updated {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .admin-info-row strong,
:root[data-theme-mode="dark"] .helpdesk-column-head h3,
:root[data-theme-mode="dark"] .helpdesk-admin-section-head h3,
:root[data-theme-mode="dark"] .helpdesk-admin-item-main strong,
:root[data-theme-mode="dark"] .helpdesk-ticket-head h4,
:root[data-theme-mode="dark"] .helpdesk-detail-card h3,
:root[data-theme-mode="dark"] .helpdesk-detail-thread-head strong,
:root[data-theme-mode="dark"] .helpdesk-message-meta strong,
:root[data-theme-mode="dark"] .helpdesk-message-body,
:root[data-theme-mode="dark"] .remote-settings-head h3,
:root[data-theme-mode="dark"] .public-tool-card-head h2 {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .remote-session-ready-banner {
  background: rgba(20, 83, 45, 0.42);
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

:root[data-theme-mode="dark"] .remote-session-return-pill,
:root[data-theme-mode="dark"] .remote-session-portal-return,
:root[data-theme-mode="dark"] .remote-session-note-preview,
:root[data-theme-mode="dark"] .remote-support-service-hint {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(96, 165, 250, 0.22);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .remote-session-portal-return strong,
:root[data-theme-mode="dark"] .remote-session-portal-return p,
:root[data-theme-mode="dark"] .remote-session-note-preview,
:root[data-theme-mode="dark"] .remote-support-service-hint p {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .remote-session-ready-banner.is-progress {
  background: rgba(30, 64, 175, 0.34);
  border-color: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .remote-support-download-panel {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(59, 130, 246, 0.24);
}

:root[data-theme-mode="dark"] .remote-support-download-panel strong {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .remote-support-download-panel p {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .remote-support-success-state {
  background: rgba(20, 83, 45, 0.28);
  border-color: rgba(34, 197, 94, 0.22);
}

:root[data-theme-mode="dark"] .remote-support-success-state h3,
:root[data-theme-mode="dark"] .remote-support-success-state p {
  color: #dcfce7;
}

:root[data-theme-mode="dark"] .remote-session-side,
:root[data-theme-mode="dark"] .remote-session-main {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88));
  box-shadow: 0 24px 54px rgba(2, 6, 23, 0.34);
}

:root[data-theme-mode="dark"] .remote-session-side .helpdesk-detail-list span,
:root[data-theme-mode="dark"] .remote-session-main .helpdesk-detail-thread-head {
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="dark"] .remote-support-hero .helpdesk-hero-actions #remote-session-back {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #f8fafc !important;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-origin,
:root[data-theme-mode="dark"] .helpdesk-ticket-chip,
:root[data-theme-mode="dark"] .helpdesk-admin-badge,
:root[data-theme-mode="dark"] .inventory-attachment-item,
:root[data-theme-mode="dark"] .helpdesk-column-count {
    background: #334155 !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    color: #f8fafc !important;
  }

:root[data-theme-mode="dark"] .helpdesk-admin-toggle {
  background: rgba(15, 23, 42, 0.86) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

:root[data-theme-mode="dark"] .helpdesk-editor-toolbar button,
:root[data-theme-mode="dark"] .public-richtext-toolbar button {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

:root[data-theme-mode="dark"] .helpdesk-service-picker-panel,
:root[data-theme-mode="dark"] .helpdesk-service-branch,
:root[data-theme-mode="dark"] .helpdesk-service-leaf,
:root[data-theme-mode="dark"] .helpdesk-service-picker-empty {
  background: #0f172a !important;
  border-color: rgba(71, 85, 105, 0.48) !important;
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .helpdesk-service-branch summary,
:root[data-theme-mode="dark"] .helpdesk-service-leaf strong {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .helpdesk-service-leaf small,
:root[data-theme-mode="dark"] .helpdesk-service-picker-trigger span.is-placeholder {
  color: #94a3b8 !important;
}

@media (max-width: 1199px) {
  .public-tool-shell,
  .helpdesk-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .app-modal-form-grid-2,
  .app-modal-form-grid-3,
  .public-form-grid-2 {
    grid-template-columns: 1fr;
  }

  .public-tool-shell {
    width: min(100vw, calc(100vw - 1rem));
    padding: 1rem 0;
  }

  .public-tool-showcase,
  .public-tool-card {
    border-radius: 24px;
  }
}




.helpdesk-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.helpdesk-hero-actions #helpdesk-back-board {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.72rem 1rem;
  background: rgba(239, 246, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.22);
  color: #1e3a8a;
  cursor: pointer;
}

.helpdesk-hero-actions #helpdesk-back-board:hover,
.helpdesk-hero-actions #helpdesk-back-board:focus,
.helpdesk-hero-actions #helpdesk-back-board:active {
  background: rgba(239, 246, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.22);
  color: #1e3a8a;
  box-shadow: none;
}

.helpdesk-admin-section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.helpdesk-admin-section-actions .btn,
.helpdesk-hero-actions .btn {
  white-space: nowrap;
}

.helpdesk-admin-section-actions .btn i,
.helpdesk-hero-actions .btn i {
  margin-right: 0.45rem;
}

:root[data-theme-mode="dark"] .helpdesk-hero-actions #helpdesk-back-board {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(59, 130, 246, 0.24));
  border-color: rgba(96, 165, 250, 0.62);
  color: #eff6ff;
}

:root[data-theme-mode="dark"] .helpdesk-hero-actions #helpdesk-back-board:hover,
:root[data-theme-mode="dark"] .helpdesk-hero-actions #helpdesk-back-board:focus,
:root[data-theme-mode="dark"] .helpdesk-hero-actions #helpdesk-back-board:active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(59, 130, 246, 0.24));
  border-color: rgba(96, 165, 250, 0.62);
  color: #eff6ff;
  box-shadow: none;
}

@media (max-width: 900px) {
  .helpdesk-admin-section-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Inventory action strips */
.inventory-page-actions {
  margin: -0.1rem 0 1rem;
}

.inventory-actions-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.inventory-actions-copy {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.inventory-actions-copy strong {
  color: #0f172a;
  font-size: 1rem;
}

.inventory-actions-copy small {
  color: #64748b;
  font-size: 0.84rem;
}

.inventory-actions-eyebrow {
  display: inline-flex;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inventory-actions-shell--compact {
  padding: 0.95rem 1rem;
}

.inventory-actions-shell--compact .inventory-actions-copy strong {
  font-size: 0.95rem;
}

/* Helpdesk board, drag and drop and attachments */
.helpdesk-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
}

.helpdesk-column {
  flex: 0 0 340px;
  min-height: 560px;
  scroll-snap-align: start;
}

.helpdesk-column-list {
  min-height: 260px;
  flex: 1 1 auto;
}

.helpdesk-ticket-card[draggable="true"] {
  cursor: grab;
}

.helpdesk-ticket-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.985);
}

.helpdesk-column-list.is-drop-target {
  outline: 2px dashed rgba(37, 99, 235, 0.3);
  outline-offset: 8px;
  background: rgba(37, 99, 235, 0.04);
  border-radius: 18px;
}

.helpdesk-file-picker,
/* Deflection da KB no /helpdesk/abrir: sugestões enquanto o visitante descreve
   o problema (só tokens --color-*, sem cor crua — respeita o budget do arquivo). */
.public-kb-deflection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-primary-soft);
}

.public-kb-deflection-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.public-kb-deflection-head i {
  color: var(--color-primary);
}

.public-kb-deflection-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.public-kb-deflection-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.public-kb-deflection-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.public-kb-deflection-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.public-kb-deflection-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.public-kb-deflection-card-copy strong {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.public-kb-deflection-card-copy small {
  color: var(--color-text-soft);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.public-file-picker {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.public-file-label {
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
}

.helpdesk-file-actions,
.public-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.helpdesk-file-actions small,
.public-file-actions small {
  color: #64748b;
  font-size: 0.8rem;
}

.helpdesk-file-list,
.public-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.helpdesk-file-item,
.public-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.86);
}

.helpdesk-file-item strong,
.public-file-item strong {
  display: block;
  color: #0f172a;
  font-size: 0.9rem;
}

.helpdesk-file-item small,
.public-file-item small {
  color: #64748b;
  font-size: 0.76rem;
}

.helpdesk-file-empty,
.public-file-empty {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  color: #64748b;
  background: rgba(248, 250, 252, 0.72);
}

.public-tool-feedback {
  width: 100%;
}

.public-tool-feedback-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.88);
}

.public-tool-feedback-card strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.public-tool-feedback-card span {
  color: #475569;
  font-size: 0.84rem;
}

.public-tool-feedback-card.is-success {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(236, 253, 245, 0.92);
}

.public-tool-feedback-card.is-success strong {
  color: #047857;
}

.public-tool-feedback-card.is-error {
  border-color: rgba(239, 68, 68, 0.18);
  background: rgba(254, 242, 242, 0.94);
}

.public-tool-feedback-card.is-error strong {
  color: #b91c1c;
}

:root[data-theme-mode="dark"] .inventory-actions-shell,
:root[data-theme-mode="dark"] .helpdesk-file-item,
:root[data-theme-mode="dark"] .public-file-item,
:root[data-theme-mode="dark"] .helpdesk-file-empty,
:root[data-theme-mode="dark"] .public-file-empty,
:root[data-theme-mode="dark"] .public-tool-feedback-card {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

:root[data-theme-mode="dark"] .inventory-actions-copy strong,
:root[data-theme-mode="dark"] .helpdesk-file-item strong,
:root[data-theme-mode="dark"] .public-file-item strong,
:root[data-theme-mode="dark"] .public-tool-feedback-card strong,
:root[data-theme-mode="dark"] .public-file-label {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .inventory-actions-copy small,
:root[data-theme-mode="dark"] .inventory-actions-eyebrow,
:root[data-theme-mode="dark"] .helpdesk-file-item small,
:root[data-theme-mode="dark"] .public-file-item small,
:root[data-theme-mode="dark"] .helpdesk-file-actions small,
:root[data-theme-mode="dark"] .public-file-actions small,
:root[data-theme-mode="dark"] .helpdesk-file-empty,
:root[data-theme-mode="dark"] .public-file-empty,
:root[data-theme-mode="dark"] .public-tool-feedback-card span {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] .helpdesk-column-list.is-drop-target {
  background: rgba(37, 99, 235, 0.12);
  outline-color: rgba(96, 165, 250, 0.48);
}

@media (max-width: 1100px) {
  .inventory-actions-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .inventory-actions-group {
    width: 100%;
    justify-content: flex-start;
  }
}

.inventory-actions-group .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.78rem 1rem;
  border-radius: 16px;
  border-width: 1px;
  box-shadow: none;
}

.inventory-actions-group .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.3);
}

.inventory-actions-group .btn-outline-primary {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
}

.inventory-actions-group .btn-outline-primary:hover {
  background: rgba(239, 246, 255, 0.96);
  color: #1e40af;
}

.helpdesk-admin-shell--single {
  display: block;
}

.helpdesk-admin-shell--single .helpdesk-admin-section {
  min-height: auto;
}

.helpdesk-board {
  flex-wrap: nowrap !important;
  width: max-content;
  min-width: 100%;
}

.helpdesk-column {
  flex: 0 0 340px;
  max-width: 340px;
}

.helpdesk-column-list {
  min-height: 280px;
}

:root[data-theme-mode="dark"] .inventory-actions-group .btn-outline-primary {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .inventory-actions-group .btn-outline-primary:hover {
  background: rgba(30, 41, 59, 0.94);
  color: #dbeafe;
}


/* Inventory toolbar polish */
.inventory-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.inventory-toolbar-head h5 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
}

.inventory-toolbar-head p {
  margin: 0.28rem 0 0;
  color: #64748b;
  font-size: 0.84rem;
  max-width: 60ch;
}

.inventory-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.inventory-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inventory-toolbar-actions .btn {
  min-height: 42px;
  border-radius: 14px;
  padding: 0.7rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.inventory-toolbar-actions .btn-outline-primary {
  background: rgba(255,255,255,0.92);
  border-color: rgba(59, 130, 246, 0.24);
  color: #2563eb;
}

.inventory-toolbar-actions .btn-outline-primary:hover {
  background: rgba(239,246,255,0.96);
  border-color: rgba(59, 130, 246, 0.3);
}

.inventory-toolbar-actions .btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: 0;
}

.inventory-import-checklist {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--color-text-soft);
  font-size: 0.84rem;
}

.inventory-import-checklist li + li {
  margin-top: 0.28rem;
}

.inventory-import-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.9rem;
}

.helpdesk-board {
  flex-wrap: nowrap;
  min-width: 100%;
}

.helpdesk-column {
  flex: 0 0 min(340px, calc(100vw - 3rem));
}

@media (max-width: 991.98px) {
  .inventory-toolbar-head {
    flex-direction: column;
  }

  .inventory-toolbar-meta,
  .inventory-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

:root[data-theme-mode="dark"] .inventory-toolbar-head {
  background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(15,23,42,0.84));
  border-color: rgba(71, 85, 105, 0.4);
}

:root[data-theme-mode="dark"] .inventory-toolbar-head h5 {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .inventory-toolbar-head p {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-toolbar-actions .btn-outline-primary {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .inventory-toolbar-actions .btn-outline-primary:hover {
  background: rgba(30, 41, 59, 0.92);
}

/* Inventory workspace */
.inventory-page-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.inventory-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  justify-content: flex-end;
  align-items: center;
}

.inventory-page-actions .btn {
  min-height: 46px;
  padding: 0.82rem 1rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-width: 1px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.inventory-page-actions .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.28);
}

.inventory-page-actions .btn-outline-primary {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}

.inventory-page-actions .btn-outline-primary:hover {
  background: rgba(239, 246, 255, 0.98);
  color: #1e3a8a;
}

.inventory-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.inventory-toolbar-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-toolbar-copy h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.75rem, 2.2vw, 2.35rem);
  line-height: 1.04;
}

.inventory-toolbar-copy p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  max-width: 68ch;
}

.inventory-toolbar-btn {
  min-height: 44px;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.inventory-toolbar-btn:hover {
  background: rgba(248, 250, 252, 0.98);
}

.inventory-toolbar-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.28);
  color: #ffffff;
}

.inventory-toolbar-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #ffffff;
}

.inventory-toolbar-btn-secondary {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}

.inventory-toolbar-btn-secondary:hover {
  background: rgba(239, 246, 255, 0.98);
  color: #1e3a8a;
}

/* KB editor — status pill (substitui o checkbox de publicar) */
.knowledge-article-status {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.knowledge-status-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
}

.knowledge-status-pill i {
  font-size: 0.85rem;
}

.knowledge-status-pill.is-published {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}

.knowledge-status-pill.is-draft {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  color: #b45309;
}

.knowledge-status-pill.is-new {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.26);
  color: #1d4ed8;
}

:root[data-theme-mode="dark"] .knowledge-status-pill.is-published {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.36);
  color: #6ee7b7;
}

:root[data-theme-mode="dark"] .knowledge-status-pill.is-draft {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fcd34d;
}

:root[data-theme-mode="dark"] .knowledge-status-pill.is-new {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.36);
  color: #bfdbfe;
}

/* Frescor: selo "Desatualizado" (amber via tokens de warning, dark-safe). */
.knowledge-stale-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.knowledge-tree-chip.knowledge-tree-chip-stale {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

/* Insights: selo de feedback por artigo (👍/👎) + resumo agregado. Tokens. */
.knowledge-feedback-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
}

.knowledge-feedback-mini i {
  font-size: 0.85em;
}

.knowledge-feedback-mini.is-negative {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.knowledge-feedback-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--color-success-soft);
  color: var(--color-success-text);
  font-size: 13px;
}

.knowledge-feedback-summary-sub {
  opacity: 0.85;
  font-weight: 500;
}

/* KB editor — toggle "Disponível para todas as empresas" (artigo compartilhado) */
.knowledge-article-shared {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.knowledge-shared-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.knowledge-shared-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.knowledge-shared-toggle-track {
  flex: 0 0 auto;
  position: relative;
  width: 38px;
  height: 22px;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.knowledge-shared-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.knowledge-shared-toggle input:checked + .knowledge-shared-toggle-track {
  background: #4F46E5;
}

.knowledge-shared-toggle input:checked + .knowledge-shared-toggle-track .knowledge-shared-toggle-thumb {
  transform: translateX(16px);
}

.knowledge-shared-toggle input:focus-visible + .knowledge-shared-toggle-track {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

.knowledge-shared-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.knowledge-shared-toggle-hint {
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
  color: #64748b;
}

:root[data-theme-mode="dark"] .knowledge-shared-toggle-track {
  background: #475569;
}

:root[data-theme-mode="dark"] .knowledge-shared-toggle-hint {
  color: #94a3b8;
}

.inventory-page-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inventory-action-row {
  width: 100%;
}

.inventory-action-row-shell,
.helpdesk-page-actions > .inventory-actions-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.inventory-action-row-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.inventory-action-row-eyebrow {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-action-row-copy strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.inventory-action-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.helpdesk-page-actions,
.helpdesk-page-actions > * {
  width: 100%;
}

.inventory-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.inventory-summary-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.inventory-summary-card.tone-primary {
  border-color: rgba(59, 130, 246, 0.18);
}

.inventory-summary-card.tone-success {
  border-color: rgba(16, 185, 129, 0.2);
}

.inventory-summary-card.tone-warning {
  border-color: rgba(245, 158, 11, 0.24);
}

.inventory-summary-card.tone-danger {
  border-color: rgba(239, 68, 68, 0.18);
}

.inventory-summary-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 1.15rem;
}

.inventory-summary-card.tone-primary .inventory-summary-icon {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.inventory-summary-card.tone-success .inventory-summary-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.inventory-summary-card.tone-warning .inventory-summary-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.inventory-summary-card.tone-danger .inventory-summary-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.inventory-summary-card strong {
  display: block;
  margin: 0;
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.18;
}

.inventory-summary-card span {
  display: block;
  margin-top: 0.15rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.inventory-summary-card small {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.84rem;
}

.inventory-filter-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(150px, 0.85fr));
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.inventory-filter-strip label,
.helpdesk-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
}

.inventory-filter-strip label > span,
.helpdesk-filter-grid label > span {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-filter-strip .inventory-filter-input,
.inventory-filter-strip .inventory-filter-select,
.inventory-filter-strip .form-control,
.inventory-filter-strip .form-select {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  padding-inline: 0.9rem;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

.inventory-filter-strip .inventory-filter-input::placeholder,
.inventory-filter-strip .form-control::placeholder {
  color: #94a3b8;
  font-size: 0.92rem;
  text-overflow: ellipsis;
}

.inventory-filter-strip .inventory-filter-wide {
  min-width: 0;
}

.helpdesk-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.helpdesk-filter-grid .inventory-filter-input,
.helpdesk-filter-grid .inventory-filter-select,
.helpdesk-filter-grid .form-control,
.helpdesk-filter-grid .form-select {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

.inventory-grid-2,
.inventory-grid-3,
.inventory-grid-4 {
  display: grid;
  gap: 1rem;
}

.inventory-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.inventory-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.inventory-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.inventory-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.inventory-dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
    var(--color-surface-solid);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
}

.inventory-dashboard-card-featured {
  background: var(--gradient-hero-accent);
  color: var(--color-hero-accent-text);
}

.inventory-dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-dashboard-card-head h3 {
  margin: 0.2rem 0 0;
  color: var(--color-text);
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.inventory-dashboard-card-head p {
  max-width: 46rem;
  margin: 0.35rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.inventory-dashboard-card-featured .inventory-toolbar-eyebrow,
.inventory-dashboard-card-featured .inventory-dashboard-card-head h3,
.inventory-dashboard-card-featured .inventory-dashboard-card-head p {
  color: #f8fafc;
}

.inventory-dashboard-card-featured .inventory-dashboard-card-head p {
  color: #cbd5e1;
}

.inventory-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.inventory-dashboard-metrics div {
  display: grid;
  gap: 0.22rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.12);
}

.inventory-dashboard-metrics strong {
  color: #ffffff;
  font-size: 1.55rem;
  line-height: 1;
}

.inventory-dashboard-metrics span {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-dashboard-alert-list,
.inventory-dashboard-bar-list {
  display: grid;
  gap: 0.7rem;
}

.inventory-dashboard-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.78rem 0.85rem;
  border-radius: 18px;
  background: var(--color-surface-muted);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.inventory-dashboard-alert > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.inventory-dashboard-alert strong {
  display: block;
  color: var(--color-text);
  font-size: 0.92rem;
}

.inventory-dashboard-alert p {
  margin: 0.12rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.inventory-dashboard-alert em {
  min-width: 2.4rem;
  color: var(--color-text);
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.inventory-dashboard-alert.tone-success > span {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.inventory-dashboard-alert.tone-warning > span {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.inventory-dashboard-alert.tone-danger > span {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.inventory-dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 42%) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.78rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.inventory-dashboard-bar-copy {
  min-width: 0;
}

.inventory-dashboard-bar-copy strong,
.inventory-dashboard-bar-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-dashboard-bar-copy strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.inventory-dashboard-bar-copy span,
.inventory-dashboard-bar-row small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.inventory-dashboard-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-muted);
}

.inventory-dashboard-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #0284c7);
}

.inventory-entity-card,
.inventory-report-card {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: var(--color-surface-solid);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.inventory-report-grid {
  margin-top: 0.85rem;
  align-items: start;
}

.inventory-entity-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-entity-head h3,
.inventory-report-card h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.08rem;
}

.inventory-entity-head p,
.inventory-report-card p {
  margin: 0.28rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.inventory-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.inventory-inline-btn {
  min-height: 38px;
  padding: 0.52rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: var(--color-surface-solid);
  color: #2563eb;
  font-weight: 700;
}

.inventory-inline-btn:hover {
  background: var(--color-surface-muted);
  color: #1d4ed8;
}

.inventory-muted-copy {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* Barra de seleção da tela de Suprimentos. Fica dentro do table shell, logo
   acima da tabela: tira "Selecionar p/ repor" e "Gerar pedido de reposição"
   do hero, que ficava com 5 botões espremendo o título numa coluna estreita.
   Só tokens aqui — o tema escuro vem de graça pelos tokens semânticos. */
.inventory-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.inventory-selection-count {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.inventory-selection-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inventory-selection-actions .inventory-toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bloco "+ Fornecedor" embutido nos modais de suprimento. Não dá pra abrir o
   cadastro de fornecedor por cima daqui: só um Swal abre por vez e o modal
   atual seria substituído, perdendo o que o usuário já tinha preenchido. */
.inventory-inline-create {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.inventory-inline-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px dashed var(--color-border-strong);
  background: var(--color-surface-muted);
}

.inventory-inline-create-form[hidden] {
  display: none;
}

.inventory-inline-create-form .swal2-input {
  margin: 0;
  width: 100%;
  min-width: 0;
}

.inventory-inline-create-msg {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-danger-text);
  font-size: 0.82rem;
  text-align: left;
}

.inventory-inline-create-msg:empty {
  display: none;
}

.inventory-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.inventory-facts-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.inventory-facts-grid span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-facts-grid strong {
  color: var(--color-text);
  font-size: 0.96rem;
}

.inventory-chip-stack,
.inventory-link-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inventory-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.inventory-chip.tone-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.inventory-chip.tone-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.inventory-chip.tone-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.inventory-chip.tone-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.inventory-chip.tone-muted {
  background: rgba(148, 163, 184, 0.16);
  color: var(--color-text-muted);
}

.inventory-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Scrollable container — capped so many-empresa tenants don't produce an infinite stack */
.inventory-breakdown-scroll {
  max-height: clamp(180px, 32vh, 320px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Compact row: single line, label left + count right, with a proportion bar behind */
.inventory-breakdown-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.inventory-breakdown-row:last-child {
  border-bottom: none;
}

/* Proportion bar — light primary tint behind the row content */
.inventory-breakdown-row::before {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--bar-pct, 0%);
  background: var(--color-primary);
  opacity: 0.16;
  border-radius: 0 6px 6px 0;
  pointer-events: none;
  z-index: 0;
}

.inventory-breakdown-label {
  position: relative;
  z-index: 1;
  color: var(--color-text);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.inventory-breakdown-count {
  position: relative;
  z-index: 1;
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.25;
}

.inventory-import-helper {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.inventory-field-label {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.84rem;
}

.inventory-empty-state {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 1.1rem 0.1rem 0.4rem;
}

.inventory-empty-state i {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.inventory-empty-state h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.15rem;
}

.inventory-empty-state p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.inventory-editor-shell {
  width: 100%;
}

.inventory-editor-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 30px;
  background: var(--color-surface-solid);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
}

.inventory-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.inventory-editor-copy {
  display: grid;
  gap: 0.42rem;
  max-width: 56rem;
}

.inventory-editor-copy h2 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.55rem, 2vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.inventory-editor-copy p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.inventory-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inventory-editor-card .form-label {
  margin-bottom: 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-editor-card .form-control,
.inventory-editor-card .form-select {
  min-height: 50px;
  border-radius: 16px;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

.inventory-editor-card textarea.form-control {
  min-height: 120px;
  padding-top: 0.9rem;
}

/* Grupo "Fornece" do cadastro de fornecedor: as duas opções lado a lado, numa
   linha própria — longe do switch "Fornecedor ativo", que fala de outra coisa
   (habilitado x em que telas aparece). Quebra para coluna no celular. */
.inventory-scope-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-block: var(--space-2);
}

.inventory-scope-checks .form-check {
  margin-bottom: 0;
}

.inventory-upload-shell {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: var(--color-surface-muted);
}

.inventory-upload-shell .btn {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  padding-inline: 1rem;
  border-radius: 14px;
  font-weight: 700;
}

.inventory-upload-preview,
.inventory-existing-upload-list {
  display: grid;
  gap: 0.7rem;
}

.inventory-upload-item,
.inventory-existing-upload-item {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--color-surface-solid);
}

.inventory-existing-upload-item {
  grid-template-columns: auto 1.25rem minmax(0, 1fr);
}

.inventory-existing-upload-item input {
  margin-top: 0;
}

.inventory-upload-item i,
.inventory-existing-upload-item i {
  color: #2563eb;
  font-size: 1rem;
}

.inventory-upload-item strong,
.inventory-existing-upload-item strong {
  display: block;
  color: var(--color-text);
  font-size: 0.92rem;
}

.inventory-upload-item small,
.inventory-existing-upload-item small,
.inventory-upload-shell small {
  color: var(--color-text-muted);
}

.inventory-upload-empty {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.inventory-station-workspace {
  display: grid;
  gap: 1.25rem;
}

.inventory-station-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.9);
  width: fit-content;
}

.inventory-station-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.inventory-station-tabs button.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.inventory-station-panel {
  display: none;
}

.inventory-station-panel.active {
  display: block;
}

.inventory-station-diary-list {
  display: grid;
  gap: 0.85rem;
}

.inventory-station-diary-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
}

.inventory-station-diary-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.inventory-station-diary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-station-diary-head strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.inventory-station-diary-head time,
.inventory-station-diary-meta {
  color: #64748b;
  font-size: 0.82rem;
}

.inventory-station-diary-entry p {
  margin: 0.35rem 0 0;
  color: #475569;
  line-height: 1.55;
}

.inventory-station-diary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.inventory-station-diary-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.inventory-station-empty-panel {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 168px;
  padding: 1.75rem 1.5rem;
  border: 1px dashed var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  text-align: center;
  color: #64748b;
}

.inventory-station-empty-panel.compact {
  min-height: 132px;
}

/* O círculo do ícone vai no WRAPPER <span>, não no <i> — o FontAwesome
   sobrescreve display/line-height do <i>, mas não toca no span. Mesmo padrão
   que .inventory-station-diary-icon (que já funciona). */
.inventory-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.25rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 1.25rem;
}

.inventory-station-empty-panel strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.inventory-station-empty-panel span {
  max-width: 32rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Barra de ações no rodapé do formulário — salvar sem voltar ao topo */
.inventory-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.inventory-editor-footer .ds-button {
  min-width: 160px;
}

.inventory-station-photo-upload {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  margin-bottom: 1rem;
}

.inventory-station-photo-upload .btn {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.inventory-station-photo-upload small {
  color: #64748b;
}

.inventory-station-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.inventory-station-photo-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: var(--color-surface-solid);
}

.inventory-station-photo-preview {
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e8f0;
  aspect-ratio: 4 / 3;
}

.inventory-station-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.inventory-station-photo-preview:hover img {
  transform: scale(1.035);
}

.inventory-station-photo-card strong {
  display: block;
  color: #0f172a;
  font-size: 0.9rem;
}

.inventory-station-photo-card span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
}

.inventory-station-photo-modal .swal2-image {
  max-height: 78vh;
  object-fit: contain;
}

.inventory-filter-strip + .inventory-grid,
.inventory-filter-strip + .inventory-empty-state {
  margin-top: 1rem;
}

.inventory-station-panel[data-station-panel="data"].active,
.inventory-station-panel[data-station-panel="diary"].active,
.inventory-station-panel[data-station-panel="photos"].active {
  padding: 1.2rem;
  border-radius: 24px;
  background: transparent;
}

.inventory-station-panel[data-station-panel="term"].active {
  padding: 1.2rem;
  border-radius: 24px;
  background: transparent;
}

.inventory-station-panel[data-station-panel="tickets"].active {
  padding: 1.2rem;
  border-radius: 24px;
  background: transparent;
}

.inventory-ticket-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--color-text);
}
.inventory-ticket-count { font-weight: 700; }
.inventory-ticket-list { display: flex; flex-direction: column; }
.inventory-ticket-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}
.inventory-ticket-row:hover .inventory-ticket-subject { text-decoration: underline; }
.inventory-ticket-num { font-weight: 700; white-space: nowrap; }
.inventory-ticket-subject {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-ticket-age { margin-left: auto; white-space: nowrap; opacity: .7; font-size: 12px; }
.inventory-ticket-expand {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
}
.inventory-tab-count { margin-left: 6px; }

/* ===== Aba Termo de Responsabilidade — card + layout ===== */

/* Card externo que envolve toda a aba */
.inventory-term-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: 1.25rem 1.5rem;
}

/* Cabeçalho da aba: título à esquerda, botão à direita */
.inventory-term-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.875rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.inventory-term-head-title {
  font-size: 1.075rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.inventory-term-head-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-soft, #64748b);
}

/* Lista de termos */
.inventory-term-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Linha de cada termo */
.inventory-term-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.inventory-term-row:last-child {
  border-bottom: none;
}

/* Grupo badges + meta (cresce para preencher) */
.inventory-term-row-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 0;
  min-width: 0;
}

/* Grupo botões de ação empurrado para a direita */
.inventory-term-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Meta (colaborador · data) */
.inventory-term-row-meta {
  font-size: 0.82rem;
  color: var(--color-text-soft, #64748b);
}

/* Aviso de falha — largura total, abaixo dos badges */
.inventory-term-row-reason {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--color-danger, #dc2626);
  margin-top: 0.15rem;
}

/* Link de fotos — largura total */
.inventory-term-photos-placeholder {
  flex-basis: 100%;
  margin-top: 0.3rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--color-primary, #2563eb);
}

/* Aviso SMTP dentro do painel */
.inventory-term-smtp-warning {
  margin-bottom: 1rem;
}

/* Conteúdo do modal de termo (campos + fotos) */
.inventory-term-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  padding: 4px 2px 2px;
}

.inventory-term-modal .inventory-term-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

/* Bloco de variáveis de prompt */
.inventory-term-prompt-vars {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inventory-station-panel[data-station-panel="data"] .row {
  --bs-gutter-x: 1.15rem;
  --bs-gutter-y: 1.15rem;
}

/* Secoes do formulario de ativo (Identificacao / Atribuicao / Tecnico / Aquisicao / Observacoes) */
.inventory-form-section {
  padding: 1.15rem 1.25rem 1.3rem;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
}

.inventory-form-section + .inventory-form-section,
.inventory-form-section + .inventory-form-advanced {
  margin-top: 0.25rem;
}

.inventory-form-section-head {
  margin-bottom: 0.85rem;
}

.inventory-form-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-soft, #64748b);
}

.inventory-form-section-hint {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-soft, #94a3b8);
}

.inventory-form-advanced {
  border: 1px dashed rgba(148, 163, 184, 0.32);
  border-radius: 16px;
  padding: 0.4rem 1.25rem 0.4rem;
  background: var(--color-surface-muted);
}

.inventory-form-advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-soft, #475569);
  user-select: none;
}

.inventory-form-advanced > summary::-webkit-details-marker {
  display: none;
}

.inventory-form-advanced > summary::before {
  content: "\f054"; /* fa caret/chevron-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.7rem;
  margin-right: 0.55rem;
  display: inline-block;
  transition: transform 0.18s ease;
}

.inventory-form-advanced[open] > summary::before {
  transform: rotate(90deg);
}

.inventory-form-advanced > .row {
  padding-bottom: 0.85rem;
}

.inventory-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
}

.inventory-field-label-row .form-label {
  margin-bottom: 0;
}

.inventory-field-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-field-action:hover {
  color: #1d4ed8;
}

.inventory-workplace-quick {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.inventory-workplace-quick p {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.5;
}

.inventory-workplace-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.inventory-workplace-quick-grid label {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}

.inventory-workplace-quick-grid label > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

.inventory-workplace-quick-grid .col-span-2 {
  grid-column: 1 / -1;
}

/* Modal "+ Novo tipo de ativo" — builder de campos especificos */
.inventory-asset-type-quick {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.inventory-asset-type-quick p {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.5;
}

.inventory-asset-type-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.inventory-asset-type-quick-grid label {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}

.inventory-asset-type-quick-grid label > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

.inventory-asset-type-quick-grid .col-span-2 {
  grid-column: 1 / -1;
}

.inventory-asset-type-quick-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.inventory-asset-type-quick-fields-head > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

#quick-asset-type-fields {
  display: grid;
  gap: 0.6rem;
}

.quick-asset-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.quick-asset-field .quick-af-label {
  flex: 2 1 180px;
}

.quick-asset-field .quick-af-type {
  flex: 1 1 140px;
}

/* Input de opcoes ocupa a linha inteira (segunda linha) quando visivel — escondido,
   sai do fluxo e nao deixa buraco. */
.quick-asset-field .quick-af-options {
  flex: 1 1 100%;
  order: 5;
}

.quick-af-required-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  white-space: nowrap;
}

.quick-af-remove {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
  cursor: pointer;
}

.quick-af-remove:hover {
  background: rgba(239, 68, 68, 0.12);
}

.inventory-station-diary-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.inventory-station-diary-entry {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border-radius: 16px;
}

.inventory-station-diary-icon {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  font-size: 0.88rem;
}

.inventory-station-diary-head strong {
  font-size: 0.9rem;
}

.inventory-station-diary-entry p {
  margin-top: 0.22rem;
  font-size: 0.88rem;
  line-height: 1.38;
}

.inventory-station-diary-changes {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.45rem;
  color: #475569;
  font-size: 0.78rem;
}

.inventory-station-diary-changes span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-diary-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 800;
}

.inventory-diary-detail-list {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.inventory-diary-detail-list article {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-muted);
}

.inventory-diary-detail-list article > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
}

.inventory-diary-detail-list span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inventory-diary-detail-list p {
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.inventory-station-photo-gallery {
  grid-template-columns: repeat(auto-fill, minmax(150px, 190px));
  align-items: start;
}

.inventory-station-photo-card {
  max-width: 190px;
  padding: 0.65rem;
  border-radius: 16px;
}

.inventory-station-photo-preview {
  aspect-ratio: 1 / 1;
  max-height: 150px;
}

.inventory-station-photo-upload .inventory-upload-preview {
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
}

/* .device-type-hero / .device-type-form-card (itens-monitorados/new "Qual
   categoria?" + equipment/new) têm gradiente claro hardcoded em layout.css
   (@layer pages) que NÃO flipa no escuro → texto claro sumia sobre fundo
   claro. Override na @layer overrides com gradiente navy (espelha a moldura
   escura do .inventory-page-hero). Gradiente de 2 paradas não cabe num único
   token flipante. */
:root[data-theme-mode="dark"] .device-type-hero,
:root[data-theme-mode="dark"] .device-type-form-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88));
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-page-actions .btn-outline-primary,
:root[data-theme-mode="dark"] .inventory-action-row-shell,
:root[data-theme-mode="dark"] .helpdesk-page-actions > .inventory-actions-shell,
:root[data-theme-mode="dark"] .inventory-editor-card,
:root[data-theme-mode="dark"] .inventory-summary-card,
:root[data-theme-mode="dark"] .inventory-filter-strip,
:root[data-theme-mode="dark"] .inventory-entity-card,
:root[data-theme-mode="dark"] .inventory-report-card,
:root[data-theme-mode="dark"] .inventory-facts-grid > div,
:root[data-theme-mode="dark"] .inventory-import-helper {
  background: rgba(15, 23, 42, 0.88) !important;
  border-color: rgba(71, 85, 105, 0.42) !important;
}

/* Proportion bar is more visible on dark navy backgrounds */
:root[data-theme-mode="dark"] .inventory-breakdown-row::before {
  opacity: 0.24;
}

/* Row separator in dark mode */
:root[data-theme-mode="dark"] .inventory-breakdown-row {
  border-bottom-color: rgba(71, 85, 105, 0.3);
}

:root[data-theme-mode="dark"] .inventory-summary-card strong,
:root[data-theme-mode="dark"] .inventory-action-row-copy strong,
:root[data-theme-mode="dark"] .inventory-summary-card span,
:root[data-theme-mode="dark"] .inventory-toolbar-copy h2,
:root[data-theme-mode="dark"] .inventory-entity-head h3,
:root[data-theme-mode="dark"] .inventory-report-card h3,
:root[data-theme-mode="dark"] .inventory-facts-grid strong,
:root[data-theme-mode="dark"] .inventory-breakdown-count,
:root[data-theme-mode="dark"] .inventory-empty-state h3 {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .inventory-summary-card small,
:root[data-theme-mode="dark"] .inventory-action-row-eyebrow,
:root[data-theme-mode="dark"] .inventory-toolbar-eyebrow,
:root[data-theme-mode="dark"] .inventory-editor-copy p,
:root[data-theme-mode="dark"] .inventory-editor-card .form-label,
:root[data-theme-mode="dark"] .inventory-toolbar-copy p,
:root[data-theme-mode="dark"] .inventory-entity-head p,
:root[data-theme-mode="dark"] .inventory-report-card p,
:root[data-theme-mode="dark"] .inventory-muted-copy,
:root[data-theme-mode="dark"] .inventory-facts-grid span,
:root[data-theme-mode="dark"] .inventory-breakdown-label,
:root[data-theme-mode="dark"] .inventory-import-helper,
:root[data-theme-mode="dark"] .inventory-field-label,
:root[data-theme-mode="dark"] .inventory-empty-state p,
:root[data-theme-mode="dark"] .inventory-empty-state i {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] .inventory-editor-copy h2,
:root[data-theme-mode="dark"] .inventory-upload-item strong,
:root[data-theme-mode="dark"] .inventory-existing-upload-item strong {
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .inventory-upload-shell,
:root[data-theme-mode="dark"] .inventory-upload-item,
:root[data-theme-mode="dark"] .inventory-existing-upload-item,
:root[data-theme-mode="dark"] .inventory-upload-empty {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-station-tabs,
:root[data-theme-mode="dark"] .inventory-station-diary-entry,
:root[data-theme-mode="dark"] .inventory-station-empty-panel,
:root[data-theme-mode="dark"] .inventory-station-photo-upload,
:root[data-theme-mode="dark"] .inventory-station-photo-card {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-station-diary-head strong,
:root[data-theme-mode="dark"] .inventory-station-empty-panel strong,
:root[data-theme-mode="dark"] .inventory-station-photo-card strong {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .inventory-station-diary-entry p,
:root[data-theme-mode="dark"] .inventory-station-diary-head time,
:root[data-theme-mode="dark"] .inventory-station-diary-meta,
:root[data-theme-mode="dark"] .inventory-station-empty-panel,
:root[data-theme-mode="dark"] .inventory-station-photo-upload small,
:root[data-theme-mode="dark"] .inventory-station-photo-card span {
  color: #cbd5e1;
}

/* Aba Termo — dark mode (tokens cobrem border/bg; só o que o token não resolve) */
:root[data-theme-mode="dark"] .inventory-term-card {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-term-head {
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-term-head-title {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .inventory-term-head-subtitle {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-term-row {
  border-color: rgba(71, 85, 105, 0.3);
}

:root[data-theme-mode="dark"] .inventory-term-row-meta {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-chip {
  background: rgba(51, 65, 85, 0.86);
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-inline-btn {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(96, 165, 250, 0.26);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .inventory-inline-btn:hover {
  background: rgba(30, 41, 59, 0.96);
  color: #dbeafe;
}

:root[data-theme-mode="dark"] .inventory-toolbar-btn {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(71, 85, 105, 0.42);
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .inventory-toolbar-btn:hover {
  background: rgba(30, 41, 59, 0.96);
}

:root[data-theme-mode="dark"] .inventory-toolbar-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(59, 130, 246, 0.38);
  color: #ffffff;
}

:root[data-theme-mode="dark"] .inventory-toolbar-btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}

@media (max-width: 991.98px) {
  .inventory-filter-strip {
    grid-template-columns: 1fr;
  }

  .inventory-page-actions {
    justify-content: flex-start;
  }

  .inventory-editor-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inventory-action-row-shell,
  .helpdesk-page-actions > .inventory-actions-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .inventory-action-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}


/* 2026-03-31 Inventory + Helpdesk cleanup */
.inventory-action-row-shell-plain {
  justify-content: flex-end;
}

.inventory-action-row-shell-plain .inventory-action-row-actions {
  width: 100%;
  justify-content: flex-end;
}

.inventory-page-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.inventory-summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.inventory-summary-card {
  gap: 0.75rem;
  padding: 0.78rem 0.9rem;
  align-items: center;
}

.inventory-summary-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 1rem;
}

.inventory-summary-card > div > strong {
  display: block;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-summary-card > div > span {
  display: block;
  margin-top: 0.18rem;
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.05;
}

.inventory-summary-card > div > small {
  display: block;
  margin-top: 0.22rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.inventory-filter-strip {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) repeat(3, minmax(150px, 1fr));
  gap: 0.9rem;
  align-items: end;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.94);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.inventory-filter-strip > label,
.helpdesk-filter-grid > label {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
}

.inventory-filter-strip .inventory-filter-wide,
.helpdesk-filter-grid .helpdesk-filter-wide {
  grid-column: span 2;
}

.inventory-filter-strip .inventory-filter-input,
.inventory-filter-strip .inventory-filter-select,
.helpdesk-filter-grid .inventory-filter-input,
.helpdesk-filter-grid .inventory-filter-select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.78rem 0.9rem;
  font-size: 0.95rem;
}

.inventory-filter-strip .inventory-filter-input::placeholder,
.helpdesk-filter-grid .inventory-filter-input::placeholder {
  font-size: 0.84rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inventory-report-grid {
  margin-top: 1.35rem;
  gap: 1.15rem;
  align-items: start;
}

.inventory-report-card {
  margin-top: 0;
}

.helpdesk-page-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.helpdesk-toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.helpdesk-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.helpdesk-toolbar-eyebrow {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helpdesk-toolbar-copy strong {
  color: #0f172a;
  font-size: 1rem;
}

.helpdesk-toolbar-copy small {
  color: #64748b;
  font-size: 0.84rem;
}

.helpdesk-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.helpdesk-filter-shell {
  margin-top: 1rem;
}

.helpdesk-workspace-board {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.helpdesk-workspace-board .helpdesk-filter-shell {
  margin-top: 0;
}

.helpdesk-workspace-board .helpdesk-board {
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.helpdesk-workspace-board .helpdesk-column-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Hide scrollbar mas mantem scrollavel */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}

.helpdesk-workspace-board .helpdesk-column-list::-webkit-scrollbar {
  display: none; /* Chromium, Safari */
}

#dash:has(.helpdesk-workspace-board) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.helpdesk-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.helpdesk-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  overflow: visible;
  padding-bottom: 0;
  align-items: start;
}

.helpdesk-board-loading .helpdesk-column {
  min-height: 280px;
}

.helpdesk-column {
  min-height: 420px;
  min-width: 0;
  padding: 0.7rem;
}

.helpdesk-column-head h3 {
  font-size: 0.94rem;
}

.helpdesk-column-head p {
    font-size: 0.84rem;
  }

.helpdesk-column-count {
    min-width: 2.45rem;
    height: 1.9rem;
    padding: 0 0.7rem;
    font-size: 0.85rem;
  }

.helpdesk-column-list {
  gap: 0.65rem;
  min-height: 220px;
}

.helpdesk-ticket-card {
  position: relative;
  padding: 0.75rem 0.8rem 0.72rem 0.95rem;
  border-radius: 16px;
  cursor: pointer;
}

.helpdesk-ticket-card::before {
  content: '';
  position: absolute;
  left: 0.32rem;
  top: 0.62rem;
  bottom: 0.62rem;
  width: 4px;
  border-radius: 999px;
  background: #facc15;
}

.helpdesk-ticket-card.is-low::before { background: #3b82f6; }
.helpdesk-ticket-card.is-medium::before { background: #facc15; }
.helpdesk-ticket-card.is-high::before { background: #f97316; }
.helpdesk-ticket-card.is-critical::before { background: #ef4444; }

.helpdesk-ticket-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.helpdesk-ticket-topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.helpdesk-ticket-number {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.helpdesk-ticket-head h4 {
  font-size: 0.9rem;
  line-height: 1.25;
  width: 100%;
  margin: 0;
}

.helpdesk-ticket-priority-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
  margin-top: 0.18rem;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.05);
}

.helpdesk-ticket-card.is-low .helpdesk-ticket-priority-dot { color: #3b82f6; }
.helpdesk-ticket-card.is-medium .helpdesk-ticket-priority-dot { color: #facc15; }
.helpdesk-ticket-card.is-high .helpdesk-ticket-priority-dot { color: #f97316; }
.helpdesk-ticket-card.is-critical .helpdesk-ticket-priority-dot { color: #ef4444; }

.helpdesk-ticket-stack {
  margin-top: 0.38rem;
  gap: 0.2rem;
}

.helpdesk-ticket-stack span {
  font-size: 0.8rem;
}

.helpdesk-ticket-origin {
  font-size: 0.72rem;
}

.helpdesk-ticket-chip.is-priority {
  font-weight: 700;
}

.helpdesk-ticket-updated {
  display: block;
  margin-top: 0.55rem;
  color: #64748b;
  font-size: 0.76rem;
}

.helpdesk-ticket-modal {
  max-width: 92vw;
}

.helpdesk-ticket-modal-body {
  margin: 0;
  padding-top: 0.35rem;
}

/* === Meta strip do ticket === */
.helpdesk-ticket-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.helpdesk-ticket-meta-chip,
.helpdesk-ticket-meta-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
}

.helpdesk-ticket-meta-breadcrumb {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
  white-space: normal;
  max-width: 60%;
}

.helpdesk-ticket-meta-chip i {
  font-size: 0.78em;
}

.helpdesk-ticket-meta-chip.is-priority-low { background: var(--color-info-soft); color: var(--color-info-text); border-color: transparent; }
.helpdesk-ticket-meta-chip.is-priority-medium { background: var(--color-warning-soft); color: var(--color-warning-text); border-color: transparent; }
.helpdesk-ticket-meta-chip.is-priority-high { background: rgba(249, 115, 22, 0.14); color: #c2410c; border-color: transparent; }
.helpdesk-ticket-meta-chip.is-priority-critical { background: var(--color-danger-soft); color: var(--color-danger-text); border-color: transparent; }
.helpdesk-ticket-meta-chip.is-sla-success { background: var(--color-success-soft); color: var(--color-success-text); border-color: transparent; }
.helpdesk-ticket-meta-chip.is-sla-warning { background: var(--color-warning-soft); color: var(--color-warning-text); border-color: transparent; }
.helpdesk-ticket-meta-chip.is-sla-danger { background: var(--color-danger-soft); color: var(--color-danger-text); border-color: transparent; }

.helpdesk-ticket-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: var(--space-4);
  min-height: 72vh;
  text-align: left;
  transition: grid-template-columns 0.2s ease;
}

/* Detail do ticket: o admin-page-shell vira grid 2-col, hero compacto fica
   alinhado a coluna direita (helpdesk-ticket-main) e a sidebar ocupa todo
   espaco vertical, comecando no topo. Ganho: ~40-60px de altura util em
   notebooks, alem de evitar o "rasgo" visual do hero atravessando ambas
   colunas. Usa display:contents no detail-layout pra liberar sidebar+main
   diretamente no grid pai. */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-3);
  align-items: start;
}

/* Default: filhos vao para a coluna direita (hero, banners, meta-strip). */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > * {
  grid-column: 2;
}

/* Detail-layout vira "transparente" para o grid pai: sidebar+main viram
   filhos diretos do shell e podem ser posicionados nas suas areas. */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .helpdesk-ticket-detail-layout {
  display: contents;
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) .helpdesk-ticket-sidebar {
  grid-column: 1;
  /* "1 / -1" so funciona quando todas as rows sao explicitas. Como hero,
     meta-strip e main sao auto-placed, usamos span 999 para garantir que
     a sidebar atravesse todas as rows implicitas. */
  grid-row: 1 / span 999;
  align-self: stretch;
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) .helpdesk-ticket-main {
  grid-column: 2;
}

/* Hero compacto so dentro do contexto do detail (nao afeta as outras
   telas que usam o mesmo .admin-page-hero generico). */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero {
  padding: 0.7rem 1.1rem;
  margin-bottom: 0;
  align-items: center;
}

/* h2 + p numa unica linha (Ticket #N · Assunto), separados por bullet,
   tamanho maior pra leitura imediata. Uso flex no wrapper interno do
   hero (gerado por pageShell) e ::before no <p> para o separador. */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero > div:first-child {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: 0;
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero h2 {
  font-size: 1.25rem;
  margin: 0;
  line-height: 1.2;
  flex-shrink: 0;
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero p {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.95;
  font-weight: var(--font-weight-medium, 500);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero p::before {
  content: "•";
  opacity: 0.55;
  font-size: 1rem;
}

.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout) > .admin-page-hero.helpdesk-hero .helpdesk-hero-actions .ds-button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Estado sidebar colapsada precisa funcionar no novo grid pai. */
.admin-page-shell.helpdesk-workspace:has(> .helpdesk-ticket-detail-layout.is-sidebar-collapsed) {
  grid-template-columns: 40px minmax(0, 1fr);
}

/* Sidebar colapsada: vira coluna fina (40px) com so o toggle visivel */
.helpdesk-ticket-detail-layout.is-sidebar-collapsed {
  grid-template-columns: 40px minmax(0, 1fr);
}

.helpdesk-ticket-detail-layout.is-sidebar-collapsed .helpdesk-ticket-sidebar {
  padding: var(--space-2);
  overflow: hidden;
  position: relative;
}

.helpdesk-ticket-detail-layout.is-sidebar-collapsed .helpdesk-ticket-sidebar > *:not(.helpdesk-ticket-sidebar-toggle) {
  display: none !important;
}

.helpdesk-ticket-sidebar {
  position: relative;
}

.helpdesk-ticket-sidebar-toggle {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-solid);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  z-index: 5;
}

.helpdesk-ticket-sidebar-toggle:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-200);
}

.helpdesk-ticket-detail-layout.is-sidebar-collapsed .helpdesk-ticket-sidebar-toggle {
  position: relative;
  top: 0;
  right: 0;
  margin: 0 auto;
}

.helpdesk-ticket-sidebar,
.helpdesk-ticket-main {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-sm);
}

.helpdesk-ticket-sidebar {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.helpdesk-ticket-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.helpdesk-ticket-sidebar-head h3,
.helpdesk-ticket-main-head h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  /* Quebra titulos longos sem espaco (ex: dddddd...) sem estourar o sidebar */
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.helpdesk-ticket-sidebar-head .helpdesk-ticket-number {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-muted);
}

.helpdesk-ticket-sidebar-subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-snug);
  overflow-wrap: anywhere;
}

.helpdesk-ticket-sidebar-head p,
.helpdesk-ticket-main-head p,
.helpdesk-ticket-sidebar-section span {
  color: var(--color-text-muted);
}

.helpdesk-ticket-save-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-top: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.helpdesk-ticket-save-state[data-tone="saving"] {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.helpdesk-ticket-save-state[data-tone="success"] {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.helpdesk-ticket-save-state[data-tone="error"] {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

/* === Sidebar groups (Solicitação / Categorização / Atendimento) === */
.helpdesk-ticket-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
}

.helpdesk-ticket-sidebar-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.helpdesk-ticket-sidebar-group-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1) 0;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-muted);
}

.helpdesk-ticket-sidebar-group-head i {
  color: var(--color-primary);
  font-size: 0.85em;
}

.helpdesk-ticket-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: 0;
  border-top: 0;
}

.helpdesk-ticket-sidebar-section strong {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

/* === Description card === */
.helpdesk-ticket-description-card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
}

.helpdesk-ticket-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  flex-wrap: wrap;
}

.helpdesk-ticket-description-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.helpdesk-ticket-description-title i {
  color: var(--color-primary);
}

.helpdesk-ticket-description-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
}

.helpdesk-ticket-description-body {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  /* Limita a 140px por padrao; descricoes longas ganham um botao "Ver mais"
     no rodape do card. JS adiciona o botao apenas quando ha conteudo a mais. */
  max-height: 140px;
  overflow: hidden;
  position: relative;
  transition: max-height var(--transition-fast);
}

/* Fade-out na parte inferior para sinalizar que ha mais conteudo. */
.helpdesk-ticket-description-card:not(.is-expanded) .helpdesk-ticket-description-body.is-clipped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--color-surface-solid, #fff));
  pointer-events: none;
}

.helpdesk-ticket-description-card.is-expanded .helpdesk-ticket-description-body {
  max-height: none;
}

.helpdesk-ticket-description-toggle {
  margin-top: var(--space-2);
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  padding: 0;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.helpdesk-ticket-description-toggle:hover {
  text-decoration: underline;
}

/* Galeria de thumbnails: aparece logo apos a descricao quando ela esta
   clipada e contem imagens. Click no thumb abre o lightbox sem precisar
   expandir o texto. */
.helpdesk-ticket-description-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border-subtle);
}

.helpdesk-ticket-description-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  overflow: hidden;
  background: var(--color-surface-muted);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.helpdesk-ticket-description-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
}

.helpdesk-ticket-description-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  margin: 0 !important;
  border-radius: 0 !important;
  pointer-events: none;
}

.helpdesk-ticket-description-body img,
.helpdesk-ticket-description-body p img,
.helpdesk-ticket-description-body div img,
.helpdesk-ticket-description-body figure img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: var(--space-2) 0 !important;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

.helpdesk-ticket-description-body p {
  margin: 0 0 var(--space-2) 0;
}

.helpdesk-ticket-description-body p:last-child {
  margin-bottom: 0;
}

.helpdesk-ticket-main {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.helpdesk-ticket-editor-shell {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  /* IMPORTANTE: sem overflow:hidden — clipava o popover do botao Macros
     (position:absolute) impedindo o scroll interno do dropdown. Os filhos
     ja respeitam o border-radius via seus proprios cantos. */
  overflow: visible;
}

.helpdesk-ticket-editor-tabs,
.helpdesk-ticket-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
}

.helpdesk-ticket-editor-tabs {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  /* Tom suave pra diferenciar a barra de visibilidade/formatacao do
     corpo do editor (que e branco). */
  background: var(--color-surface-muted);
}

.helpdesk-ticket-editor-tabs button {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

/* `--color-primary-text` e nao `--color-primary`: o primary sobre o proprio
   soft dava 2.49:1 no claro e 4.20:1 no escuro — reprovava nos DOIS temas. O
   token -text existe justamente pra tinta sobre fundo soft. */
.helpdesk-ticket-editor-tabs button[data-ticket-tab="public"].is-active {
  color: var(--color-primary-text);
  background: var(--color-primary-soft);
}

.helpdesk-ticket-editor-tabs button[data-ticket-tab="internal"] {
  color: var(--color-internal-text);
}

.helpdesk-ticket-editor-tabs button[data-ticket-tab="internal"].is-active {
  color: var(--color-internal-text);
  background: var(--color-internal-soft);
}

.helpdesk-ticket-editor-inline-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-inline: auto;
}

.helpdesk-ticket-editor-inline-tools button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: #fff;
}

.helpdesk-ticket-editor {
  min-height: 140px;
  padding: 0.9rem;
  outline: none;
  transition: min-height var(--transition-fast);
}

/* === Quill rich editor (Snow theme overrides) === */
.helpdesk-rich-editor {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-solid);
}

.helpdesk-rich-toolbar.ql-toolbar {
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.5rem 0.7rem;
  background: var(--color-surface-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

.helpdesk-rich-toolbar.ql-toolbar .ql-formats {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  border-right: 1px solid rgba(226, 232, 240, 0.7);
  margin: 0;
}

.helpdesk-rich-toolbar.ql-toolbar .ql-formats:last-child {
  border-right: 0;
}

.helpdesk-rich-toolbar.ql-toolbar button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.helpdesk-rich-toolbar.ql-toolbar button:hover,
.helpdesk-rich-toolbar.ql-toolbar button.ql-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.helpdesk-rich-toolbar.ql-toolbar .helpdesk-rich-custom {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.helpdesk-rich-toolbar.ql-toolbar .helpdesk-rich-custom:hover {
  color: var(--color-primary);
}

.helpdesk-rich-editor-body.ql-container {
  border: 0;
  font-size: var(--font-size-sm);
  font-family: var(--font-family-base, inherit);
}

.helpdesk-rich-editor-body .ql-editor {
  min-height: 140px;
  padding: 0.9rem;
}

.helpdesk-rich-editor-body .ql-editor:focus-within {
  outline: 0;
}

.helpdesk-rich-editor-body .ql-editor img {
  max-width: 100%;
  height: auto;
  /* Cursor "default" porque dentro do editor click serve pra selecionar
     pra resize, nao para abrir lightbox. */
  cursor: default;
  border-radius: var(--radius-sm);
  transition: outline-color var(--transition-fast);
}

.helpdesk-rich-editor-body .ql-editor img.helpdesk-rich-image-selected {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Overlay de resize: position:fixed sobre a imagem ativa, com 4 handles
   nos cantos. Nao interfere no DOM do Quill (esta no document.body). */
.helpdesk-rich-image-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border: 2px dashed var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
  box-sizing: border-box;
}

.helpdesk-rich-image-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--color-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.helpdesk-rich-image-handle.is-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.helpdesk-rich-image-handle.is-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.helpdesk-rich-image-handle.is-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.helpdesk-rich-image-handle.is-se { bottom: -8px; right: -8px; cursor: nwse-resize; }

/* Popover de emoji */
.helpdesk-rich-emoji-popover {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: 280px;
}

.helpdesk-rich-emoji-item {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition-fast);
}

.helpdesk-rich-emoji-item:hover {
  background: var(--color-surface-muted);
}

/* Modais de link / tabela */
.helpdesk-rich-modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-2);
}

.helpdesk-rich-modal-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.helpdesk-rich-modal-form input[type="text"],
.helpdesk-rich-modal-form input[type="url"],
.helpdesk-rich-modal-form input[type="number"] {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.helpdesk-rich-modal-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-2) !important;
  font-weight: var(--font-weight-medium, 500);
}

/* Chips de anexos do editor de resposta (detail). Mostra arquivos
   selecionados para envio + permite remover antes do submit. */
.helpdesk-ticket-reply-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.helpdesk-ticket-reply-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary-text, #1d4ed8);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  max-width: 240px;
}

.helpdesk-ticket-reply-attachment-chip > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.helpdesk-ticket-reply-attachment-remove {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}

.helpdesk-ticket-reply-attachment-remove:hover {
  background: rgba(15, 23, 42, 0.1);
}

/* Tabelas inseridas */
.helpdesk-rich-table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-2) 0;
}

.helpdesk-rich-table td,
.helpdesk-rich-table th {
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-2);
  min-width: 60px;
}

/* KB picker modal */
.helpdesk-kb-picker-popup .swal2-html-container {
  padding: 0 !important;
  margin-top: 1rem;
}

.helpdesk-kb-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.helpdesk-kb-picker-search {
  position: relative;
  display: flex;
  align-items: center;
}

.helpdesk-kb-picker-search > i {
  position: absolute;
  left: 12px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.helpdesk-kb-picker-search input[type="search"] {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
}

.helpdesk-kb-picker-search input[type="search"]:focus {
  outline: 0;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.helpdesk-kb-picker-results {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.helpdesk-kb-picker-item {
  text-align: left;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.helpdesk-kb-picker-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.helpdesk-kb-picker-item-head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
}

.helpdesk-kb-picker-item-head i {
  color: var(--color-primary);
}

.helpdesk-kb-picker-item-summary {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.helpdesk-kb-picker-item-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.helpdesk-kb-picker-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--color-surface-muted);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.helpdesk-kb-picker-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.helpdesk-kb-picker-empty.is-error {
  color: var(--color-danger, #c2410c);
}

/* Trigger compacto pra os <input type="color"> da toolbar do editor.
   Visual identico aos demais botoes da toolbar (.helpdesk-ticket-shortcuts-btn:
   34x34 com border + bg muted). */
.helpdesk-ticket-editor-color-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.helpdesk-ticket-editor-color-trigger:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-200);
  color: var(--color-primary);
}

.helpdesk-ticket-editor-color-trigger > i {
  font-size: 0.95rem;
}

/* Pequena faixa de cor abaixo do icone indicando a cor atual selecionada. */
.helpdesk-ticket-editor-color-trigger::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-trigger-swatch, currentColor);
  pointer-events: none;
}

.helpdesk-ticket-editor-color-trigger > input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

/* Estado expandido: o usuario clica no botao de "expandir editor" pra ganhar
   ~50vh de altura editavel quando estiver compondo respostas longas. */
.helpdesk-ticket-editor-shell.is-expanded .helpdesk-ticket-editor {
  min-height: 50vh;
}

.helpdesk-ticket-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

/* Tickets criados/editados antes da serializacao limpa podem trazer o
   .helpdesk-editor-image-wrap salvo no banco. Quando esse markup aparece
   FORA do editor (na thread ou na descricao), neutralizamos a UI de
   resize: nada de borda, handles invisiveis, cursor de zoom no lugar
   do "default". JS ja remove o wrap em novos saves; isso aqui cuida do
   passado. */
.helpdesk-ticket-thread .helpdesk-editor-image-wrap,
.helpdesk-ticket-description-card .helpdesk-editor-image-wrap {
  border: 0 !important;
  box-shadow: none !important;
  cursor: zoom-in;
  resize: none !important;
}

.helpdesk-ticket-thread .helpdesk-editor-image-handle,
.helpdesk-ticket-description-card .helpdesk-editor-image-handle {
  display: none !important;
  pointer-events: none !important;
}

/* Wrapper redimensionavel para imagens coladas no editor.
   8 handles JS-driven (4 cantos + 4 lados) substituem o resize:both nativo
   que so suporta canto inferior-direito. Selecionavel com clique para deletar
   via teclado. */
.helpdesk-editor-image-wrap {
  display: inline-block;
  position: relative;
  overflow: visible;
  max-width: 100%;
  max-height: 70vh;
  vertical-align: bottom;
  margin: var(--space-2) 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
  cursor: default;
  user-select: none;
}

.helpdesk-editor-image-wrap:hover,
.helpdesk-editor-image-wrap.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.helpdesk-editor-image-wrap > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Handles de resize: ficam invisiveis ate hover/selecao para nao poluir o
   editor; ainda assim continuam clicaveis (pointer-events sempre on) pra
   permitir agarrar a borda diretamente. */
.helpdesk-editor-image-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: auto;
  transition: opacity var(--transition-fast);
  z-index: 2;
}

.helpdesk-editor-image-wrap:hover .helpdesk-editor-image-handle,
.helpdesk-editor-image-wrap.is-selected .helpdesk-editor-image-handle {
  opacity: 1;
}

.helpdesk-editor-image-handle.is-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.helpdesk-editor-image-handle.is-n  { top: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.helpdesk-editor-image-handle.is-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.helpdesk-editor-image-handle.is-e  { top: 50%; right: -7px; transform: translateY(-50%); cursor: ew-resize; }
.helpdesk-editor-image-handle.is-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.helpdesk-editor-image-handle.is-s  { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.helpdesk-editor-image-handle.is-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.helpdesk-editor-image-handle.is-w  { top: 50%; left: -7px; transform: translateY(-50%); cursor: ew-resize; }

.helpdesk-ticket-editor-actions {
  justify-content: space-between;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.helpdesk-ticket-create-layout .helpdesk-ticket-sidebar-section {
  gap: 0.8rem;
}

.helpdesk-ticket-create-layout .helpdesk-ticket-sidebar-section label,
.helpdesk-ticket-create-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.helpdesk-ticket-create-layout .helpdesk-ticket-sidebar-section label span,
.helpdesk-ticket-create-field span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.helpdesk-ticket-toggle-shell {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.helpdesk-ticket-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.72rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.72));
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.helpdesk-ticket-toggle-btn:hover,
.helpdesk-ticket-toggle-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.34);
}

.helpdesk-ticket-toggle-btn.is-active {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.96), rgba(37, 99, 235, 0.9));
  border-color: rgba(30, 64, 175, 0.92);
  color: #ffffff !important;
}

.helpdesk-ticket-toggle-btn.is-active span,
.helpdesk-ticket-toggle-btn.is-active i {
  color: #ffffff !important;
}

.helpdesk-ticket-toggle-shell small {
  color: #64748b;
  line-height: 1.45;
}

.helpdesk-ticket-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(241, 245, 249, 0.82));
}

.helpdesk-ticket-editor-toolbar button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #fff;
  color: #334155;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.helpdesk-ticket-editor-toolbar button:hover,
.helpdesk-ticket-editor-toolbar button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.42);
  color: #1d4ed8;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.helpdesk-ticket-card.is-internal-task {
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(224, 242, 254, 0.9));
  border-color: rgba(14, 165, 233, 0.22);
}

.helpdesk-ticket-card.is-internal-task::before {
  background: #0ea5e9;
}

.helpdesk-ticket-kind-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-toggle-btn {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  border-color: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-toggle-btn.is-active {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.88));
  color: #eff6ff;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-toggle-shell small {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-editor-toolbar {
  border-color: rgba(71, 85, 105, 0.4);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.78));
}

:root[data-theme-mode="dark"] .helpdesk-ticket-editor-toolbar button {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(71, 85, 105, 0.42);
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card.is-internal-task {
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.92), rgba(12, 74, 110, 0.84));
  border-color: rgba(56, 189, 248, 0.3);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-kind-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

.helpdesk-ticket-create-shell {
  display: flex;
  flex-direction: column;
}

.helpdesk-ticket-create-shell .helpdesk-ticket-editor {
  min-height: 260px;
}

.helpdesk-ticket-upload-shell {
  padding: 0.9rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.helpdesk-ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  /* Ocupa todo espaco vertical disponivel dentro do .helpdesk-ticket-main
     (que e flex column). Evita area vazia entre o historico e o rodape. */
  flex: 1 1 auto;
}

.helpdesk-ticket-thread > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.helpdesk-ticket-thread-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.helpdesk-ticket-thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  /* Cresce ate o limite do .helpdesk-ticket-thread (que e flex:1 dentro do
     main); rolagem interna so quando ha conteudo demais. Antes tinha
     max-height: 34vh fixo, deixando area vazia abaixo em viewports altos. */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.helpdesk-ticket-thread.is-history-expanded,
.helpdesk-ticket-main.is-history-expanded .helpdesk-ticket-thread {
  flex: 1 1 auto;
}

.helpdesk-ticket-detail-layout.is-history-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.helpdesk-ticket-detail-layout.is-history-expanded .helpdesk-ticket-sidebar {
  display: none;
}

.helpdesk-ticket-detail-layout.is-history-expanded .helpdesk-ticket-main {
  grid-column: 1 / -1;
  min-height: calc(100vh - 240px);
}

.helpdesk-ticket-main.is-history-expanded .helpdesk-ticket-editor-shell {
  display: none;
}

.helpdesk-ticket-main.is-history-expanded .helpdesk-ticket-thread-list {
  max-height: none;
  min-height: calc(100vh - 320px);
}

.helpdesk-ticket-thread-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-solid);
}

.helpdesk-ticket-thread-item.is-public {
  border-left: 4px solid var(--color-primary);
  /* Tom azul transparente alinhado com os cards do kanban — da identidade
     ao item publico sem competir com o lilas dos internos. */
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.06), transparent 38%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.55));
  border-color: rgba(191, 219, 254, 0.6);
}

.helpdesk-ticket-thread-item.is-internal {
  border-left: 4px solid var(--color-internal);
  background:
    radial-gradient(circle at 100% 0%, rgba(192, 38, 211, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(250, 245, 255, 0.98), rgba(243, 232, 255, 0.95));
  border-color: rgba(192, 38, 211, 0.20);
}

.helpdesk-ticket-thread-item.is-internal .helpdesk-ticket-thread-author-name {
  color: var(--color-internal-text);
}

/* Override antigo movido pra junto da regra principal de .helpdesk-ticket-thread-tag */

.helpdesk-ticket-thread-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
  object-fit: cover;
  background-position: center;
  background-size: cover;
}

img.helpdesk-ticket-thread-avatar {
  /* Foto de perfil — apenas garante o crop circular */
  background: var(--color-surface-muted);
}

.helpdesk-ticket-thread-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

/* Header do item agora e linha unica: nome + tag (publica/interna) + tempo,
   tudo no mesmo eixo. Evita o "salto" pra duas linhas em viewports menores
   e mantem a leitura rapida do timeline. */
.helpdesk-ticket-thread-content > header,
.helpdesk-ticket-thread-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  min-width: 0;
}

.helpdesk-ticket-thread-author-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.helpdesk-ticket-thread-header .helpdesk-ticket-thread-tag {
  flex-shrink: 0;
}

.helpdesk-ticket-thread-header .helpdesk-ticket-thread-time {
  margin-inline-start: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Indicador "editado em..." aparece ao lado do tempo quando a interacao
   foi editada apos a criacao. */
.helpdesk-ticket-thread-edited {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-style: italic;
  flex-shrink: 0;
}

/* Botoes de acao (editar/excluir) so aparecem em hover do thread item.
   Mantem o header visualmente limpo no estado normal. */
.helpdesk-ticket-thread-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.helpdesk-ticket-thread-item:hover .helpdesk-ticket-thread-actions,
.helpdesk-ticket-thread-actions:focus-within {
  opacity: 1;
}

.helpdesk-ticket-thread-action {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.helpdesk-ticket-thread-action:hover {
  background: var(--color-surface-muted);
  color: var(--color-primary);
}

.helpdesk-ticket-thread-action.helpdesk-ticket-thread-action--danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.helpdesk-ticket-thread-action i {
  font-size: 0.78rem;
}

/* Item removido: visual atenuado, sem corpo + nota "Mensagem removida". */
.helpdesk-ticket-thread-item.is-deleted {
  opacity: 0.7;
}

.helpdesk-ticket-thread-item.is-deleted .helpdesk-ticket-thread-body {
  background: rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.helpdesk-ticket-thread-deleted-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--font-size-sm);
}

/* Mount do editor dentro do modal de edicao. Garante altura minima. */
.helpdesk-thread-edit-mount {
  min-height: 240px;
  text-align: left;
}

/* Separador de dia: 'Hoje', 'Ontem' ou data dd/MM/yyyy. Renderizado entre
   grupos de mensagens do mesmo dia para escanabilidade do timeline. */
.helpdesk-ticket-thread-day {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide, 0.04em);
}

.helpdesk-ticket-thread-day::before,
.helpdesk-ticket-thread-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-border-subtle);
}

.helpdesk-ticket-thread-day > span {
  flex: 0 0 auto;
}

.helpdesk-ticket-thread-author strong {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.helpdesk-ticket-thread-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  /* Tom mais saturado pra contrastar com o card .is-public que ja usa
     primary-soft no background. */
  background: var(--color-surface-solid);
  /* Era `#1d4ed8` fixo (azul-700): sobre a superficie escura dava 2.46:1 e a
     etiqueta "Ação pública" sumia no tema escuro. O token vira shade clara la. */
  color: var(--color-primary-text);
  border: 1px solid rgba(37, 99, 235, 0.42);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.helpdesk-ticket-thread-item.is-internal .helpdesk-ticket-thread-tag {
  /* Mantem padronizacao para internos: fundo branco + borda lilas. */
  background: var(--color-surface-solid);
  border-color: rgba(192, 38, 211, 0.45);
  color: var(--color-internal-text);
}

.helpdesk-ticket-thread-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* === Componente compartilhado: user-avatar ===
   Reutilizado em ticket detail, kanban cards, listas, perfil.
   Use buildUserAvatarMarkup() para gerar o markup. */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
  font-size: var(--font-size-sm);
  color: #ffffff;
}

img.user-avatar.user-avatar--photo {
  object-fit: cover;
  background: var(--color-surface-muted);
  border: 0;
}

.user-avatar.user-avatar--fallback {
  font-family: inherit;
}

/* Botao de atalhos de teclado */
.helpdesk-ticket-shortcuts-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.helpdesk-ticket-shortcuts-btn:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* Modal de ajuda de atalhos */
.helpdesk-shortcuts-help-popup .helpdesk-shortcuts-help {
  display: grid;
  gap: var(--space-2);
  text-align: left;
  margin-top: var(--space-2);
}

.helpdesk-shortcuts-help-popup .helpdesk-shortcuts-help__row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.helpdesk-shortcuts-help-popup .helpdesk-shortcuts-help__row span {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.helpdesk-shortcuts-help-popup kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  margin: 0 2px;
}

/* Macros como chips clicaveis: linha unica.
   IMPORTANTE: sem overflow:hidden — o popover do botao "+" e position:absolute
   e seria clipado se este parent tivesse overflow oculto. */
.helpdesk-ticket-macro-chips {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  min-width: 0;
}

.helpdesk-ticket-macro-chips .helpdesk-ticket-macro-chip {
  flex-shrink: 0;
}

.helpdesk-ticket-macro-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.helpdesk-ticket-macro-chip:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-200);
  color: var(--color-primary-text);
  transform: translateY(-1px);
}

.helpdesk-ticket-macro-chip i {
  color: var(--color-warning);
  font-size: 0.75em;
}

.helpdesk-ticket-macro-chip:hover i {
  color: var(--color-primary);
}

/* Botao "+" pra abrir o popover de macros adicionais.
   Compacto (28x28) pra nao competir com os chips na linha. */
.helpdesk-ticket-macro-more {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

/* Botao "Macros" rotulado: substitui os chips fixos por um trigger unico
   que abre o popover com todas as macros. Mantem a barra do editor enxuta. */
.helpdesk-ticket-macro-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.helpdesk-ticket-macro-more-btn:hover,
.helpdesk-ticket-macro-more-btn[aria-expanded="true"] {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-200);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.helpdesk-ticket-macro-more-btn i {
  font-size: 0.75rem;
  color: var(--color-warning);
}

.helpdesk-ticket-macro-more-btn:hover i,
.helpdesk-ticket-macro-more-btn[aria-expanded="true"] i {
  color: var(--color-primary);
}

.helpdesk-ticket-macro-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.helpdesk-ticket-macro-more-menu.is-open {
  display: flex;
}

.helpdesk-ticket-macro-more-menu .helpdesk-ticket-macro-more-item {
  width: 100%;
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  text-align: left;
}

/* Filtro do historico */
.helpdesk-ticket-thread-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-subtle);
}

.helpdesk-ticket-thread-filter button {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.helpdesk-ticket-thread-filter button.is-active {
  background: var(--color-surface-solid);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

.helpdesk-ticket-thread-item[hidden] {
  display: none !important;
}

.helpdesk-ticket-thread-files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.helpdesk-ticket-thread-body {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.helpdesk-ticket-thread-body img,
.helpdesk-ticket-thread-body p img,
.helpdesk-ticket-thread-body div img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  margin: var(--space-2) 0;
}

.helpdesk-ticket-thread-body p {
  margin: 0 0 var(--space-2) 0;
}

.helpdesk-ticket-thread-body p:last-child {
  margin-bottom: 0;
}

.helpdesk-ticket-thread-quote {
  margin-top: var(--space-2);
}

.helpdesk-ticket-thread-quote > summary {
  cursor: pointer;
  width: fit-content;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  user-select: none;
}

.helpdesk-ticket-thread-quote[open] > summary {
  margin-bottom: var(--space-2);
}

.helpdesk-ticket-thread-quote-body {
  border-left: 3px solid var(--color-border);
  padding-left: var(--space-3);
  color: var(--color-text-muted);
}

/* Lightbox da imagem do ticket: usar specificity alta com `body` para
   ganhar do SweetAlert2 default. Largura fixa de 92vw com cap de 1400px. */
body .swal2-popup.helpdesk-image-preview-popup {
  width: 92vw !important;
  max-width: 1400px !important;
  max-height: 92vh !important;
  min-height: 0 !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

body .swal2-popup.helpdesk-image-preview-popup .swal2-image,
body .swal2-popup.helpdesk-image-preview-popup img.helpdesk-image-preview-image,
body .swal2-popup.helpdesk-image-preview-popup > img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 88vh !important;
  object-fit: contain;
  margin: 0 auto !important;
  display: block !important;
  border-radius: 0 !important;
}

body .swal2-popup.helpdesk-image-preview-popup .swal2-close {
  color: #ffffff !important;
  font-size: 1.4rem !important;
  width: 2.25rem !important;
  height: 2.25rem !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(6px);
  position: absolute !important;
  top: 0.85rem !important;
  right: 0.85rem !important;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

body .swal2-popup.helpdesk-image-preview-popup .swal2-close:hover,
body .swal2-popup.helpdesk-image-preview-popup .swal2-close:focus {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.42) !important;
  transform: scale(1.05);
  outline: none;
}

/* Hint visual sobre zoom */
body .swal2-popup.helpdesk-image-preview-popup::before {
  content: "Scroll para zoom · arrastar para mover · duplo clique reseta";
  position: absolute;
  bottom: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.helpdesk-ticket-thread-files a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: #1d4ed8;
  text-decoration: none;
}

.helpdesk-ticket-description-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.helpdesk-ticket-description-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--color-surface-solid);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.helpdesk-ticket-description-attachment:hover,
.helpdesk-ticket-description-attachment:focus-visible {
  background: var(--color-surface-muted);
  border-color: rgba(99, 102, 241, 0.55);
  transform: translateY(-1px);
  outline: none;
}

.helpdesk-ticket-description-attachment i {
  color: #64748b;
}

.helpdesk-ticket-description-attachment-name {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.helpdesk-ticket-description-attachment small {
  color: #64748b;
  font-weight: 500;
  padding-left: 0.45rem;
  margin-left: 0.1rem;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.public-tool-shell.helpdesk-public-shell {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 1rem;
  min-height: auto;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.helpdesk-public-shell .public-tool-showcase {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
  min-height: 104px;
  max-height: 140px;
  overflow: hidden;
  padding: 0.9rem 1.25rem;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.helpdesk-public-shell .public-tool-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  text-decoration: none;
}

.helpdesk-public-shell .public-tool-brand img {
  width: 104px;
  height: 58px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.18));
}

.helpdesk-public-shell .helpdesk-public-header-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.helpdesk-public-shell .helpdesk-public-header-copy h1 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.38rem;
  line-height: 1.08;
}

.helpdesk-public-shell .helpdesk-public-header-copy p {
  margin: 0;
  max-width: 58rem;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.92rem;
  line-height: 1.42;
}

.helpdesk-public-shell .public-tool-login-link {
  position: static;
  justify-self: end;
  white-space: nowrap;
}

.helpdesk-public-shell .public-tool-card {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

@media (max-width: 1399.98px) {
  .helpdesk-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .inventory-filter-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-filter-strip .inventory-filter-wide {
    grid-column: 1 / -1;
  }

  .helpdesk-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .helpdesk-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .helpdesk-toolbar-row,
  .inventory-action-row-shell,
  .inventory-action-row-shell-plain {
    grid-template-columns: 1fr;
  }

  .inventory-action-row-shell-plain .inventory-action-row-actions,
  .helpdesk-toolbar-actions {
    justify-content: flex-start;
  }

  .helpdesk-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .helpdesk-filter-grid .helpdesk-filter-wide {
    grid-column: span 2;
  }

  .helpdesk-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .helpdesk-public-shell .public-tool-showcase {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
  }

  .helpdesk-public-shell .public-tool-brand img {
    width: 76px;
    height: 44px;
  }

  .helpdesk-ticket-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .inventory-filter-strip,
  .helpdesk-filter-grid,
  .helpdesk-board {
    grid-template-columns: 1fr;
  }

  .inventory-filter-strip .inventory-filter-wide,
  .helpdesk-filter-grid .helpdesk-filter-wide {
    grid-column: auto;
  }

  .helpdesk-public-shell .public-tool-showcase {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    min-height: 86px;
    padding: 0.75rem 0.85rem;
    border-radius: 20px;
  }

  .helpdesk-public-shell .public-tool-brand {
    display: inline-flex;
  }

  .helpdesk-public-shell .public-tool-brand img {
    width: 58px;
    height: 38px;
  }

  .helpdesk-public-shell .helpdesk-public-header-copy h1 {
    font-size: 1.06rem;
  }

  .helpdesk-public-shell .helpdesk-public-header-copy p {
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .helpdesk-public-shell .public-tool-login-link {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }

  .helpdesk-public-shell .public-tool-login-link span {
    display: none;
  }
}

:root[data-theme-mode="dark"] .helpdesk-toolbar-row {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(71, 85, 105, 0.4);
}

:root[data-theme-mode="dark"] .helpdesk-status-column,
:root[data-theme-mode="dark"] .helpdesk-status-empty {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(71, 85, 105, 0.4);
}

:root[data-theme-mode="dark"] .helpdesk-status-column-copy h3,
:root[data-theme-mode="dark"] .helpdesk-status-empty strong {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-status-column-copy p,
:root[data-theme-mode="dark"] .helpdesk-status-empty small {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-filter-strip {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.36);
}

:root[data-theme-mode="dark"] .helpdesk-toolbar-copy strong,
:root[data-theme-mode="dark"] .inventory-summary-card span {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-toolbar-copy small {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-sidebar,
:root[data-theme-mode="dark"] .helpdesk-ticket-main,
:root[data-theme-mode="dark"] .helpdesk-ticket-editor-shell,
:root[data-theme-mode="dark"] .helpdesk-ticket-thread-item {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(71, 85, 105, 0.4);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-sidebar-head h3,
:root[data-theme-mode="dark"] .helpdesk-ticket-main-head h3 {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-editor-inline-tools button {
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="dark"] .inventory-summary-card strong,
:root[data-theme-mode="dark"] .inventory-summary-card small {
  color: #94a3b8;
}

/* Final refinements: inventory + helpdesk */
.inventory-page-shell .inventory-summary-strip {
  margin-top: 1rem;
}

.inventory-page-shell .inventory-summary-card {
  min-height: 104px;
}

.inventory-page-shell .inventory-summary-card > div > strong {
  font-size: 0.68rem;
}

.inventory-page-shell .inventory-summary-card > div > span {
  font-size: 0.98rem;
  font-weight: 800;
}

.inventory-page-shell .inventory-filter-strip {
  grid-template-columns: minmax(0, 1.65fr) repeat(3, minmax(140px, 1fr));
  margin-top: 0.9rem;
}

.inventory-page-shell .inventory-filter-strip > label > span,
.helpdesk-filter-grid > label > span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.05rem;
}

.inventory-page-shell .inventory-filter-strip .inventory-filter-input,
.inventory-page-shell .inventory-filter-strip .inventory-filter-select,
.helpdesk-filter-grid .inventory-filter-input,
.helpdesk-filter-grid .inventory-filter-select {
  min-height: 48px;
}

.inventory-page-shell .inventory-filter-strip .inventory-filter-input::placeholder,
.helpdesk-filter-grid .inventory-filter-input::placeholder {
  font-size: 0.82rem;
}

.inventory-page-shell .inventory-report-grid {
  margin-top: 1.6rem;
  row-gap: 1.3rem;
}

.inventory-page-shell .inventory-report-card {
  min-height: 152px;
}

.helpdesk-page-actions,
.helpdesk-page-actions > * {
  width: 100%;
}

.helpdesk-toolbar-row {
  width: 100%;
}

.helpdesk-toolbar-copy strong {
  font-size: 1.08rem;
}

.helpdesk-toolbar-copy small {
  max-width: 52ch;
}

.helpdesk-filter-grid {
  grid-template-columns: minmax(0, 1.2fr) repeat(5, minmax(120px, 0.8fr));
}

.helpdesk-filter-grid .helpdesk-filter-wide {
  grid-column: auto;
}

.helpdesk-board {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.helpdesk-column {
  min-height: 0;
  padding: 0.6rem;
  border-radius: 20px;
}

.helpdesk-column-head {
  margin-bottom: 0.55rem;
}

.helpdesk-column-head h3 {
  font-size: 0.88rem;
}

.helpdesk-column-head p {
  display: none;
}

.helpdesk-column-list {
  gap: 0.5rem;
  min-height: 300px;
}

.helpdesk-ticket-card {
  min-height: 132px;
  padding: 0.68rem 0.72rem 0.66rem 0.88rem;
}

.helpdesk-ticket-head h4 {
  font-size: 0.84rem;
}

.helpdesk-ticket-stack span {
  font-size: 0.74rem;
}

.helpdesk-ticket-origin {
  padding: 0.24rem 0.48rem;
  font-size: 0.68rem;
  white-space: nowrap;
}

.helpdesk-ticket-updated {
  margin-top: 0.45rem;
  font-size: 0.7rem;
}

.helpdesk-ticket-detail-layout.is-page {
  min-height: calc(100vh - 240px);
}

.helpdesk-ticket-sidebar,
.helpdesk-ticket-main {
  min-height: 100%;
}

.helpdesk-ticket-detail-hint {
  color: #64748b;
  font-size: 0.78rem;
}

.helpdesk-ticket-workspace-loading {
  padding-top: 0.35rem;
}

:root[data-theme-mode="dark"] .inventory-page-shell .inventory-filter-strip {
  background: rgba(15, 23, 42, 0.88);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-detail-hint {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-create-layout .helpdesk-ticket-sidebar-section label span,
:root[data-theme-mode="dark"] .helpdesk-ticket-create-field span {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-save-state {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-save-state[data-tone="saving"] {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-save-state[data-tone="success"] {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-save-state[data-tone="error"] {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.knowledge-editor-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.knowledge-editor-sidebar,
.knowledge-editor-main {
  min-height: calc(100vh - 260px);
  padding: 1.75rem;
}

.knowledge-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.inventory-editor-grid {
  display: grid;
  gap: 1.1rem;
}

.knowledge-editor-main .inventory-editor-head {
  margin-bottom: 1rem;
}

.knowledge-editor-body {
  min-height: calc(100vh - 420px);
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.55;
}

@media (max-width: 991.98px) {
  .knowledge-editor-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-editor-sidebar,
  .knowledge-editor-main,
  .knowledge-editor-body {
    min-height: auto;
  }
}

/* 2026-04-01 Helpdesk board compact filter row */
.helpdesk-filter-shell {
  margin-top: 1rem;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board {
  grid-template-columns: minmax(0, 1.85fr) minmax(170px, 0.55fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .helpdesk-filter-wide {
  grid-column: auto;
}

.helpdesk-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.helpdesk-filter-actions .btn {
  min-height: 42px;
  white-space: nowrap;
  padding: 0.62rem 0.82rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.helpdesk-page-shell .inventory-summary-strip {
  display: none;
}

.helpdesk-filter-shell {
  padding: 0.72rem 0.82rem;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.helpdesk-filter-grid.helpdesk-filter-grid-board > label > span {
  font-size: 0.68rem;
  margin-bottom: 0.02rem;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-input,
.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-select {
  min-height: 42px;
  padding: 0.62rem 0.82rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-input::placeholder {
  font-size: 0.8rem;
}

@media (max-width: 991.98px) {
  .helpdesk-filter-grid.helpdesk-filter-grid-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .helpdesk-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 767.98px) {
  .helpdesk-filter-grid.helpdesk-filter-grid-board {
    grid-template-columns: 1fr;
  }

  .helpdesk-filter-actions {
    grid-column: auto;
  }
}

/* 2026-04-01 Knowledge Base Public Landing */
.knowledge-public-body {
  min-height: 100vh;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(43, 80, 165, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(8, 145, 178, 0.12), transparent 28%),
    var(--color-surface-muted);
  color: var(--color-text);
}

.knowledge-public-shell {
  min-height: 100vh;
  max-width: 1120px;
  padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 32px);
  background: var(--color-surface-solid);
  overflow: visible;
}

/* KB público — faixa de pré-visualização (rota autenticada de rascunho) */
.knowledge-preview-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.4rem;
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.26);
  background: rgba(239, 246, 255, 0.92);
  color: #1e3a8a;
  font-size: 0.92rem;
  font-weight: 600;
}

.knowledge-preview-banner i {
  font-size: 1rem;
  color: #2563eb;
}

.knowledge-preview-banner strong {
  font-weight: 800;
}

.knowledge-preview-banner--draft {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(254, 243, 199, 0.7);
  color: #92400e;
}

.knowledge-preview-banner--draft i {
  color: #d97706;
}

.kb-clone-modal {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}

.kb-clone-modal .inventory-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kb-clone-modal .ds-field {
  width: 100%;
}

.kb-clone-hint {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-soft);
}

.knowledge-public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.35rem 0 1.2rem;
}

.knowledge-public-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
}

.knowledge-public-brand img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.knowledge-public-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
}

.knowledge-public-hero {
  position: relative;
  overflow: hidden;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 0;
  text-align: center;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(11, 31, 67, 0.96) 0%, rgba(27, 52, 95, 0.94) 55%, rgba(42, 78, 120, 0.92) 100%);
  box-shadow: 0 28px 80px rgba(11, 31, 67, 0.22);
}

.knowledge-public-hero::before,
.knowledge-public-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.knowledge-public-hero::before {
  inset: auto auto -120px -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
}

.knowledge-public-hero::after {
  inset: -90px -20px auto auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(110, 231, 255, 0.18), transparent 66%);
}

.knowledge-public-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.knowledge-public-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.knowledge-public-hero-copy h1 {
  margin: 12px 0 16px;
  color: #ffffff;
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.knowledge-public-hero-copy p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--color-text-soft);
  font-size: 18px;
  line-height: 1.72;
}

/* Wrapper que centraliza a busca e é o contexto de posicionamento do painel
   de resultados (autocomplete). A largura/margem antes viviam no shell. */
.knowledge-search {
  position: relative;
  z-index: 5;
  max-width: 560px;
  margin: 32px auto 24px;
}

.knowledge-search-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-md);
  transition: border-color 120ms, box-shadow 120ms;
}

.knowledge-search-shell:focus-within {
  border-color: #6366F1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.18);
}

.knowledge-search-shell i {
  color: var(--color-text-muted);
  font-size: 1.2rem;
}

.knowledge-search-shell input {
  flex: 1;
  border: 0;
  outline: 0;
  /* Remove o chrome nativo do <input type="search"> (a borda/box arredondada
     que alguns navegadores desenham POR DENTRO do shell). O realce de foco vive
     só no shell via :focus-within — não deve haver um segundo contorno interno. */
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--color-text);
  font-size: 16px;
}

/* Defensivo: zera qualquer outline/box-shadow de foco que possa ser herdado no
   input (o foco é desenhado no shell). */
.knowledge-search-shell input:focus,
.knowledge-search-shell input:focus-visible {
  outline: 0;
  box-shadow: none;
}

/* Decorações nativas do search no WebKit (lupa/limpar) que reintroduzem caixa. */
.knowledge-search-shell input::-webkit-search-decoration,
.knowledge-search-shell input::-webkit-search-cancel-button,
.knowledge-search-shell input::-webkit-search-results-button,
.knowledge-search-shell input::-webkit-search-results-decoration,
.knowledge-search-field input::-webkit-search-decoration,
.knowledge-search-field input::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}

/* Mesmo tratamento no campo de busca da vista de grupo (mesma classe de bug). */
.knowledge-search-field input {
  appearance: none;
  -webkit-appearance: none;
}

.knowledge-search-shell input::placeholder {
  color: var(--color-text-muted);
}

/* Painel de resultados da busca (autocomplete) — abre sob a barra, sobreposto
   ao conteúdo (o hero precisa de overflow:visible pra não recortar). 100% token,
   adapta ao modo escuro. */
.knowledge-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-lg);
}

.knowledge-search-results[hidden] {
  display: none;
}

.knowledge-search-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

.knowledge-search-result:hover,
.knowledge-search-result.is-active {
  background: var(--color-primary-soft);
}

.knowledge-search-result strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.knowledge-search-result small {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-search-status {
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
}

.knowledge-public-hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 1.35rem;
  color: var(--color-text-soft);
  font-size: 14px;
}

.knowledge-public-hero-meta strong {
  color: var(--color-text);
}

.knowledge-public-groups {
  max-width: 1320px;
  margin: 1.4rem auto 0;
  padding: 0.5rem 0 2rem;
}

.knowledge-public-groups-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.35rem;
}

.knowledge-public-section-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--color-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.knowledge-public-groups-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.knowledge-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.knowledge-group-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 228px;
  padding: 24px;
  border-radius: 14px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.knowledge-group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong, var(--color-border));
}

.knowledge-group-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 122px;
  padding: 1rem;
  border-radius: 18px;
  background: var(--color-surface-muted);
}

.knowledge-group-card-brand img {
  max-width: 100%;
  max-height: 74px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* No escuro o backplate da marca (--color-surface-muted) fica navy e os logos
   PRETOS dos grupos somem. Mantém-se uma placa clara SÓ no escuro para os logos
   continuarem visíveis (o card ao redor segue escuro). Light mode inalterado. */
:root[data-theme-mode="dark"] .knowledge-group-card-brand {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.knowledge-group-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.knowledge-group-card-copy strong {
  font-size: 18px;
  line-height: 1.28;
  font-weight: 600;
  color: var(--color-text);
}

.knowledge-group-card-copy span {
  color: var(--color-text-soft);
  font-size: 14px;
}

.knowledge-group-empty-block {
  margin-top: 2.25rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--color-border);
}

.knowledge-group-empty-title {
  margin: 0 0 1rem;
  color: var(--color-text-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.knowledge-group-empty-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.knowledge-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  text-decoration: none;
  font-size: 0.92rem;
  transition: border-color 140ms ease, color 140ms ease;
}

.knowledge-group-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.knowledge-group-chip span {
  color: var(--color-text);
  font-weight: 600;
}

.knowledge-group-chip small {
  color: var(--color-text-soft);
  font-size: 0.78rem;
}

.knowledge-group-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.knowledge-public-featured {
  margin-top: 0.5rem;
}

.knowledge-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.knowledge-featured-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.2rem 1.35rem;
  border-radius: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.knowledge-featured-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.knowledge-featured-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.knowledge-featured-card strong {
  color: var(--color-text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.knowledge-featured-card small {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-featured-group {
  margin-top: 0.25rem;
  color: var(--color-text-soft);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.knowledge-group-body .knowledge-public-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.knowledge-group-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(40px, 6vw, 64px) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 32px;
}

.knowledge-group-hero .knowledge-public-hero-copy {
  max-width: 720px;
}

.knowledge-group-hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  padding: 1.25rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.knowledge-group-hero-brand img {
  max-width: 100%;
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.knowledge-group-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  max-width: 1320px;
  margin: 1.15rem auto 1.35rem;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.knowledge-group-breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
}

.knowledge-group-breadcrumbs strong {
  color: var(--color-text);
  font-weight: 700;
}

.knowledge-group-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 340px);
  gap: 1.5rem;
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}

.knowledge-group-article {
  min-width: 0;
  padding: 2.1rem 2.35rem 2.35rem;
  border-radius: 30px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.knowledge-article-head {
  padding-bottom: 1.35rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.knowledge-article-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.95rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.knowledge-article-head h2 {
  margin: 1rem 0 0.6rem;
  color: var(--color-text);
  font-size: clamp(2rem, 2.3vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.knowledge-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
  margin-bottom: 0.9rem;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.knowledge-article-meta strong {
  color: var(--color-text);
}

.knowledge-article-head p {
  max-width: 780px;
  margin: 0;
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.knowledge-article-body {
  max-width: 720px;
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.7;
}

.knowledge-article-body > :first-child {
  margin-top: 0;
}

.knowledge-article-body h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.knowledge-article-body p {
  margin-bottom: 16px;
}

.knowledge-article-body img,
.knowledge-article-body iframe,
.knowledge-article-body video {
  display: block;
  max-width: 100%;
  margin: 1.4rem auto;
  border-radius: 18px;
}

.knowledge-article-body img.knowledge-zoomable-image {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.knowledge-article-body img.knowledge-zoomable-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

/* ---- Cor do conteúdo migrado (Movidesk / colagem de Word) ----
   O corpo chegava com cor travada no style inline: preto no branco. Style
   inline vence qualquer folha de estilo, então no modo escuro o texto ficava
   preto no preto. services/richTextThemeNormalizer.js descarta as cores neutras
   (o texto passa a herdar o tema) e converte as que têm significado nestas
   classes, que seguem os tokens já calibrados pros dois temas (AA nos dois). */
.knowledge-article-body .nz-ink--danger  { color: var(--color-danger-text); }
.knowledge-article-body .nz-ink--warning { color: var(--color-warning-text); }
.knowledge-article-body .nz-ink--success { color: var(--color-success-text); }
.knowledge-article-body .nz-ink--info    { color: var(--color-info-text); }
.knowledge-article-body .nz-ink--primary { color: var(--color-primary-text); }

/* Realce de fundo: a classe define fundo E texto juntos, pra que um texto
   branco aninhado (que a normalização descarta) herde a cor legível do tom. */
.knowledge-article-body .nz-tone--danger  { background-color: var(--color-danger-soft);  color: var(--color-danger-text); }
.knowledge-article-body .nz-tone--warning { background-color: var(--color-warning-soft); color: var(--color-warning-text); }
.knowledge-article-body .nz-tone--success { background-color: var(--color-success-soft); color: var(--color-success-text); }
.knowledge-article-body .nz-tone--info    { background-color: var(--color-info-soft);    color: var(--color-info-text); }
.knowledge-article-body .nz-tone--primary { background-color: var(--color-primary-soft); color: var(--color-primary-text); }

/* Laje cinza do editor de origem: mantém o destaque, mas na cor do tema. */
.knowledge-article-body .nz-surface--muted { background-color: var(--color-surface-muted); }

/* `:where(.kb-hub) a` zera cor e sublinhado, então um link só se distinguia do
   texto pela cor inline que veio da migração. Com a cor normalizada, o corpo
   precisa marcar o link por conta própria — senão vira texto comum. */
.knowledge-article-body a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.knowledge-article-toc {
  position: sticky;
  top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.3rem;
  border-radius: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.knowledge-article-toc-title {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--color-text-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.knowledge-article-toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.knowledge-article-toc-link {
  padding: 0.34rem 0.7rem;
  border-left: 2px solid transparent;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.knowledge-article-toc-link.depth-1 {
  padding-left: 1.4rem;
  font-size: 0.85rem;
}

.knowledge-article-toc-link:hover {
  color: var(--color-text);
  background: var(--color-primary-soft);
}

.knowledge-article-toc-link.is-active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 700;
}

/* "Este artigo foi útil?" — rodapé de feedback do artigo (coluna de leitura). */
.knowledge-article-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  max-width: 720px;
  margin-top: 2.5rem;
  padding: 1.15rem 1.35rem;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted, var(--color-surface));
}

.knowledge-article-feedback-title {
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 700;
}

.knowledge-article-feedback-actions {
  display: inline-flex;
  gap: 0.55rem;
}

.knowledge-article-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.knowledge-article-feedback-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
}

.knowledge-article-feedback-done {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.knowledge-article-feedback-done i {
  color: var(--color-success, var(--color-primary));
}

.knowledge-article-feedback-cta {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.knowledge-article-feedback-cta:hover {
  text-decoration: underline;
}

/* "Artigos relacionados" — grade de cards no fim da leitura. */
.knowledge-article-attachments {
  max-width: 720px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.knowledge-article-attachments-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--color-text);
  font-size: 1.02rem;
  font-weight: 700;
}

.knowledge-article-attachments-title i {
  color: var(--color-text-soft);
}

.knowledge-article-attachments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.knowledge-article-attachment {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.knowledge-article-attachment:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.knowledge-article-attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.knowledge-article-attachment-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.knowledge-article-attachment-copy strong {
  color: var(--color-text);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.knowledge-article-attachment-copy small {
  color: var(--color-text-soft);
  font-size: 0.8rem;
}

.knowledge-article-attachment-dl {
  flex: 0 0 auto;
  color: var(--color-text-soft);
}

.knowledge-article-attachment:hover .knowledge-article-attachment-dl {
  color: var(--color-primary);
}

/* Lista de anexos no editor admin (coluna de metadados) */
.knowledge-attach-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.knowledge-attach-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.knowledge-attach-item-icon {
  flex: 0 0 auto;
  color: var(--color-text-soft);
}

.knowledge-attach-item-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  line-height: 1.2;
}

.knowledge-attach-item-copy strong {
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  word-break: break-word;
}

.knowledge-attach-item-copy small {
  color: var(--color-text-soft);
  font-size: 0.72rem;
}

.knowledge-attach-item-remove {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.knowledge-attach-item-remove:hover {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.knowledge-attach-add {
  display: inline-flex;
  cursor: pointer;
}

/* Painel "Buscas sem resposta" (lacunas) no admin */
.knowledge-gaps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.knowledge-gap-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.knowledge-gap-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.knowledge-gap-copy strong {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.knowledge-gap-copy small {
  color: var(--color-text-soft);
  font-size: 0.78rem;
}

.knowledge-gap-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.knowledge-gap-dismiss {
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.knowledge-gap-dismiss:hover {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

@media (max-width: 640px) {
  .knowledge-gap-item {
    flex-direction: column;
    align-items: stretch;
  }
}

.knowledge-article-related {
  max-width: 720px;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--color-border);
}

.knowledge-article-related-title {
  display: block;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 700;
}

.knowledge-article-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.knowledge-article-related-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.knowledge-article-related-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.knowledge-article-related-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.knowledge-article-related-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.knowledge-article-related-copy strong {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.knowledge-article-related-copy small {
  color: var(--color-text-soft);
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .knowledge-article-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.knowledge-lightbox-open {
  overflow: hidden;
}

.knowledge-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(2, 8, 23, 0.84);
  backdrop-filter: blur(4px);
}

.knowledge-image-lightbox img {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.45);
  cursor: zoom-in;
}

.knowledge-image-lightbox.is-zoomed {
  overflow: auto;
  justify-content: safe center;
  align-items: safe center;
  cursor: grab;
}

.knowledge-image-lightbox.is-zoomed.is-panning {
  cursor: grabbing;
}

.knowledge-image-lightbox.is-zoomed img {
  border-radius: 0;
  cursor: zoom-out;
}

.knowledge-image-lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

.knowledge-image-lightbox-close:hover,
.knowledge-image-lightbox-close:focus,
.knowledge-image-lightbox-close:active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.knowledge-group-nav {
  position: sticky;
  top: 1.5rem;
  padding: 1.25rem 1.15rem 1.15rem;
  border-radius: 26px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.knowledge-group-nav-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.knowledge-group-nav-head strong {
  color: var(--color-text);
  font-size: 0.96rem;
  font-weight: 800;
}

.knowledge-group-nav-head small {
  color: var(--color-text-soft);
  font-size: 0.86rem;
}

.knowledge-group-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.knowledge-group-menu-section header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.knowledge-group-menu-section header strong {
  color: var(--color-text-soft);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.knowledge-group-menu-section header small {
  color: var(--color-text-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.knowledge-group-menu-section.depth-1 {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
}

.knowledge-group-menu-section.depth-1 header strong {
  font-size: 0.9rem;
}

.knowledge-group-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.knowledge-group-menu-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.42;
  transition: background-color 120ms;
}

.knowledge-group-menu-links a:hover {
  background-color: var(--color-surface-muted);
}

.knowledge-group-menu-links a.is-active {
  background-color: var(--color-primary-soft);
  /* Indigo fixo dava 2.4:1 sobre o azul translúcido do --color-primary-soft no
     modo escuro. O token de texto acompanha o tema (700 no claro, 300 no
     escuro) e passa de 7:1 nos dois. */
  color: var(--color-primary-text);
  font-weight: 600;
}

/* ---- KB PR-B3: subsecoes recolhiveis (collapse/expand) no menu publico ---- */
.knowledge-group-menu-sub {
  margin-top: 0.4rem;
}

.knowledge-group-menu-sub-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
  transition: background-color 120ms;
}

.knowledge-group-menu-sub-summary::-webkit-details-marker {
  display: none;
}

.knowledge-group-menu-sub-summary:hover {
  background-color: var(--color-surface-muted);
}

.knowledge-group-menu-sub-summary.is-active {
  color: var(--color-primary-text);
}

.knowledge-group-menu-sub-caret {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: transform 150ms ease;
}

.knowledge-group-menu-sub[open] > .knowledge-group-menu-sub-summary .knowledge-group-menu-sub-caret {
  transform: rotate(90deg);
}

.knowledge-group-menu-sub-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.3rem 0 0.2rem 0.55rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--color-border);
}

.knowledge-group-menu-sub-body > small {
  color: var(--color-text-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.knowledge-group-menu-sub.is-leaf {
  padding: 6px 10px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* ===================================================================
   KB PR-A: arvore admin + navegacao publica (busca/categoria/sidebar)
   =================================================================== */

/* ---- Admin: card de estrutura + layout 2 colunas ---- */
.knowledge-structure-card .knowledge-tree-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}

.knowledge-tree-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.knowledge-tree-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.knowledge-tree-filter {
  flex: 1 1 auto;
  min-width: 0;
}

.knowledge-tree-panel-toolbar .ds-button {
  flex-shrink: 0;
}

.knowledge-tree,
.knowledge-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.knowledge-tree-children {
  margin-top: 0.3rem;
  margin-left: 1.1rem;
  padding-left: 0.85rem;
  border-left: 1px dashed rgba(148, 163, 184, 0.4);
}

.knowledge-tree-node,
.knowledge-tree-leaf {
  position: relative;
}

.knowledge-tree-row,
.knowledge-tree-leaf {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--color-surface-muted);
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.knowledge-tree-row:hover,
.knowledge-tree-leaf:hover {
  background: var(--color-surface-solid);
  border-color: rgba(79, 70, 229, 0.25);
}

.knowledge-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.knowledge-tree-label > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-tree-label i {
  flex: 0 0 auto;
  color: var(--color-text-soft);
}

.knowledge-tree-leaf .knowledge-tree-label {
  font-weight: 500;
}

.knowledge-tree-leaf .knowledge-tree-label i {
  color: var(--color-text-muted);
}

.knowledge-tree-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.knowledge-tree-row-add {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  /* Declutter: some da vista até o hover/foco da linha, pra o olho escanear os
     NOMES das categorias em vez de dezenas de botões "+ Seção / + Artigo". */
  opacity: 0;
  transition: opacity 120ms ease;
}

.knowledge-tree-row:hover .knowledge-tree-row-add,
.knowledge-tree-row:focus-within .knowledge-tree-row-add {
  opacity: 1;
}

/* Grip de arrasto: affordance discreta, revelada no hover da linha/folha. */
.knowledge-tree-grip {
  flex: 0 0 auto;
  margin-right: 0.15rem;
  color: var(--color-text-soft);
  font-size: 12px;
  cursor: grab;
  opacity: 0;
  transition: opacity 120ms ease;
}

.knowledge-tree-row:hover .knowledge-tree-grip,
.knowledge-tree-row:focus-within .knowledge-tree-grip,
.knowledge-tree-leaf:hover .knowledge-tree-grip {
  opacity: 0.5;
}

/* Recolher/expandir nós da árvore de navegação */
.knowledge-tree-collapse {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.knowledge-tree-collapse:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.knowledge-tree-collapse i {
  font-size: 11px;
  transition: transform 120ms ease;
}

.knowledge-tree-node.is-collapsed > .knowledge-tree-row .knowledge-tree-collapse i {
  transform: rotate(-90deg);
}

.knowledge-tree-collapse-spacer {
  flex: 0 0 auto;
  width: 1.4rem;
  margin-right: 0.1rem;
}

.knowledge-tree-node.is-collapsed > .knowledge-tree-children {
  display: none;
}

/* Filtro ativo mostra os matches mesmo dentro de nós recolhidos */
.knowledge-tree.is-filtering .knowledge-tree-node.is-collapsed > .knowledge-tree-children {
  display: block;
}

.knowledge-tree-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.knowledge-tree-add-btn:hover {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.knowledge-tree-guide {
  text-align: left;
}

.knowledge-tree-guide strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.knowledge-tree-guide p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.knowledge-field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--color-text-soft);
}

.knowledge-tree-chip {
  flex: 0 0 auto;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92660d;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Badge "Geral" — artigo compartilhado com todas as empresas (PR-4) */
.knowledge-tree-chip-shared {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
}

:root[data-theme-mode="dark"] .knowledge-tree-chip-shared {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

.knowledge-tree-leaf.is-draft .knowledge-tree-label > span:first-of-type {
  color: var(--color-text-muted);
}

.knowledge-tree-actions-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-right: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.knowledge-tree-actions-toggle:hover {
  background: rgba(79, 70, 229, 0.1);
  color: #4F46E5;
}

.knowledge-tree-actions-menu {
  display: none;
  position: absolute;
  right: 0.3rem;
  z-index: 20;
  min-width: 188px;
  margin-top: 0.25rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: 0.1rem;
}

.knowledge-tree-actions-menu.is-open {
  display: flex;
}

.knowledge-tree-action-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.knowledge-tree-action-btn:hover:not(:disabled) {
  background: var(--color-surface-muted);
}

.knowledge-tree-action-btn:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.knowledge-tree-action-btn i {
  width: 16px;
  color: var(--color-text-muted);
}

/* ---- Admin: estados de drag-and-drop e filtro ---- */
.knowledge-tree-row.is-dragging,
.knowledge-tree-leaf.is-dragging {
  opacity: 0.5;
}

.knowledge-tree-row.kb-drop-ok,
.knowledge-tree-leaf.kb-drop-ok {
  border-color: #4F46E5;
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 1px #4F46E5;
}

.knowledge-tree-row.kb-drop-bad,
.knowledge-tree-leaf.kb-drop-bad {
  border-color: #ef4444;
  background: #fef2f2;
}

.knowledge-tree-node.is-hidden,
.knowledge-tree-leaf.is-hidden {
  display: none;
}

/* ---- Admin: editor contextual a direita ---- */
.knowledge-tree-editor {
  min-width: 0;
  align-self: stretch;
  padding: 1.35rem 1.4rem;
  border-radius: 18px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.knowledge-tree-editor .admin-empty-state {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.knowledge-tree-editor-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.knowledge-tree-editor-form h4 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: 800;
}

.knowledge-tree-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.knowledge-tree-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 0.4rem;
}

/* ---- Admin: widget de tags ---- */
.knowledge-tag-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.knowledge-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.knowledge-tag-chips:empty {
  display: none;
}

.knowledge-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: #3730a3;
  font-size: 0.8rem;
  font-weight: 600;
}

.knowledge-tag-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.16);
  color: #3730a3;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.knowledge-tag-chip button:hover {
  background: #4F46E5;
  color: #ffffff;
}

/* ---- Publica: campo de busca + sugestoes + tags ---- */
.knowledge-group-search {
  position: relative;
  max-width: 1320px;
  margin: 0 auto 1.5rem;
}

.knowledge-search-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0 1.15rem;
  border-radius: 18px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.knowledge-search-field:focus-within {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), var(--shadow-md);
}

.knowledge-search-field > i {
  color: var(--color-text-soft);
  font-size: 1.05rem;
}

.knowledge-search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text);
  font-size: 1.02rem;
}

.knowledge-search-kbd {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.4rem;
  border-radius: 7px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.knowledge-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.knowledge-search-tag {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.knowledge-search-tag:hover {
  border-color: rgba(79, 70, 229, 0.4);
  color: #3730a3;
}

.knowledge-search-tag.is-active {
  background: #4F46E5;
  border-color: #4F46E5;
  color: #ffffff;
}

.knowledge-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(58px + 0.5rem);
  z-index: 40;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 18px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.knowledge-search-suggestions[hidden] {
  display: none;
}

.knowledge-search-group + .knowledge-search-group {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
}

.knowledge-search-group-path {
  display: block;
  padding: 0.3rem 0.65rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.knowledge-search-suggestion {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  color: var(--color-text);
  text-decoration: none;
}

.knowledge-search-suggestion:hover,
.knowledge-search-suggestion.is-active {
  background: var(--color-primary-soft);
}

.knowledge-search-suggestion strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.knowledge-search-suggestion small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.knowledge-search-empty {
  padding: 1rem 0.85rem;
  text-align: center;
}

.knowledge-search-empty strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-text);
  font-size: 0.95rem;
}

.knowledge-search-empty p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.86rem;
}

.knowledge-search-empty a {
  color: var(--color-primary-text);
  font-weight: 700;
}

/* ---- Publica: cards de categoria na landing ---- */
.knowledge-group-categories {
  max-width: 1320px;
  margin: 0 auto 1.75rem;
}

.knowledge-group-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

.knowledge-group-category-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.4rem 1.45rem 1.25rem;
  border-radius: 22px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.knowledge-group-category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow-lg);
}

.knowledge-group-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--color-primary-soft);
  color: #4F46E5;
  font-size: 1.2rem;
}

.knowledge-group-category-card strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.knowledge-group-category-card small {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.knowledge-group-category-count {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---- Publica: vista de categoria (coluna do artigo) ---- */
.knowledge-category-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.knowledge-category-articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.knowledge-category-article-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.knowledge-category-article-card:hover {
  background: var(--color-surface-solid);
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateY(-2px);
}

.knowledge-category-article-card strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.knowledge-category-article-card small {
  color: var(--color-text-soft);
  font-size: 0.83rem;
  line-height: 1.45;
}

.knowledge-category-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.knowledge-category-section > header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.knowledge-category-section > header strong {
  color: var(--color-text);
  font-size: 1.02rem;
  font-weight: 800;
}

.knowledge-category-section > header small {
  color: var(--color-text-soft);
  font-size: 0.86rem;
}

.knowledge-category-empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* ---- Publica: sidebar com categoria clicavel + estado ativo ---- */
.knowledge-group-menu-category {
  display: block;
  color: var(--color-text-soft);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.knowledge-group-menu-category:hover,
.knowledge-group-menu-category.is-active,
.knowledge-group-menu-section.is-open > header .knowledge-group-menu-category {
  color: var(--color-primary-text);
}

/* ---- Responsivo das novidades PR-A ---- */
@media (max-width: 991.98px) {
  .knowledge-structure-card .knowledge-tree-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-tree-editor {
    order: -1;
  }
}

@media (max-width: 640px) {
  .knowledge-search-field {
    min-height: 52px;
    padding: 0 0.9rem;
  }

  .knowledge-search-field input {
    font-size: 0.98rem;
  }

  .knowledge-search-kbd {
    display: none;
  }

  .knowledge-search-suggestions {
    top: calc(52px + 0.4rem);
  }

  .knowledge-group-category-grid,
  .knowledge-category-articles {
    grid-template-columns: 1fr;
  }

  .knowledge-tree-children {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
  }
}

@media (max-width: 991.98px) {
  .knowledge-public-shell {
    padding: 1rem;
  }

  .knowledge-public-hero {
    padding: 2rem 1.4rem 2rem;
    border-radius: 26px;
  }

  .knowledge-public-groups-head {
    flex-direction: column;
    align-items: start;
  }

  .knowledge-group-hero {
    flex-direction: column;
  }

  .knowledge-group-hero-brand {
    min-width: 0;
    max-width: 320px;
  }

  .knowledge-group-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-group-nav {
    position: static;
    order: 2;
  }

  .knowledge-group-article {
    order: 1;
    padding: 1.65rem;
  }
}

@media (max-width: 767.98px) {
  .knowledge-public-header {
    padding-bottom: 0.9rem;
  }

  .knowledge-public-brand {
    gap: 0.7rem;
    font-size: 1rem;
  }

  .knowledge-public-brand img {
    height: 38px;
  }

  .knowledge-public-login {
    min-height: 42px;
    padding: 0 0.9rem;
  }

  .knowledge-public-hero {
    padding: 1.6rem 1.2rem 1.6rem;
  }

  .knowledge-group-breadcrumbs {
    margin: 1rem auto 1.1rem;
    font-size: 0.88rem;
  }

  .knowledge-group-article {
    padding: 1.3rem 1.1rem 1.45rem;
    border-radius: 22px;
  }

  .knowledge-group-nav {
    padding: 1rem 0.95rem;
    border-radius: 22px;
  }

  .knowledge-article-head h2 {
    font-size: 1.65rem;
  }

  .knowledge-article-body {
    font-size: 0.98rem;
    line-height: 1.78;
  }

  .knowledge-search-shell {
    min-height: 62px;
    padding: 0 1rem;
  }

  .knowledge-search-shell input {
    font-size: 1rem;
  }

  .knowledge-group-card {
    min-height: 198px;
    padding: 1rem;
    border-radius: 20px;
  }

  .knowledge-group-card-brand {
    min-height: 108px;
  }
}

.knowledge-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 360px);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  overflow: hidden;
}

.knowledge-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.knowledge-editor-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  cursor: pointer;
}

.knowledge-editor-toolbar button:hover {
  background: var(--color-primary-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.knowledge-editor-body {
  flex: 1;
  min-height: calc(100vh - 430px);
  padding: 1.1rem 1.2rem;
  background: var(--color-surface-solid);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  overflow: auto;
}

.knowledge-editor-body:focus {
  outline: none;
}

.knowledge-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
}

.knowledge-editor-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 16px;
}

.knowledge-editor-body h2,
.knowledge-editor-body h3 {
  margin: 1.25rem 0 0.75rem;
  color: #10203b;
  font-weight: 800;
}

.knowledge-editor-body p,
.knowledge-editor-body ul,
.knowledge-editor-body ol,
.knowledge-editor-body blockquote {
  margin: 0 0 1rem;
}

.knowledge-editor-body blockquote {
  padding: 0.9rem 1rem;
  border-left: 4px solid #2563eb;
  background: #f8fbff;
  border-radius: 12px;
}

.knowledge-video-embed {
  margin: 1rem 0;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
}

.knowledge-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.knowledge-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.knowledge-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
}

:root[data-theme-mode="dark"] .knowledge-editor-shell {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme-mode="dark"] .knowledge-editor-toolbar {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme-mode="dark"] .knowledge-editor-toolbar button {
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme-mode="dark"] .knowledge-editor-toolbar button:hover {
  background: rgba(37, 99, 235, 0.18);
}

:root[data-theme-mode="dark"] .knowledge-editor-body {
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .knowledge-editor-body:empty::before {
  color: #64748b;
}

:root[data-theme-mode="dark"] .knowledge-editor-body blockquote {
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .helpdesk-color-picker {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.18);
}


.knowledge-public-open-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
}

.knowledge-public-open-btn:hover,
.knowledge-public-open-btn:focus,
.knowledge-public-open-btn:active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* 2026-04-10 Kanban board single-line fit */

/* 2026-04-11 Kanban ticket card refresh */
.helpdesk-column-list {
  gap: 0.8rem;
}

.helpdesk-ticket-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 132px;
  padding: 0.9rem 0.95rem 0.92rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.helpdesk-ticket-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.helpdesk-ticket-card::before {
  left: 0.42rem;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 4px;
}

.helpdesk-ticket-head {
  gap: 0.55rem;
}

.helpdesk-ticket-topline {
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.helpdesk-ticket-ref {
  display: flex;
  align-items: center;
  min-width: 0;
}

.helpdesk-ticket-card .helpdesk-ticket-number {
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  color: #64748b;
}

.helpdesk-ticket-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.helpdesk-ticket-priority-badge,
.helpdesk-ticket-kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 1.65rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.helpdesk-ticket-priority-badge {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
}

.helpdesk-ticket-kind-badge {
  margin-left: 0;
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: rgba(14, 165, 233, 0.12);
  color: #075985;
}

.helpdesk-ticket-kind-badge i {
  font-size: 0.7rem;
}

.helpdesk-ticket-head h4 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.28;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.helpdesk-ticket-priority-dot {
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 0.62rem;
  margin-top: 0;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85);
}

.helpdesk-ticket-meta {
  display: grid;
  gap: 0.42rem;
}

.helpdesk-ticket-meta-item {
  display: grid;
  grid-template-columns: 0.85rem minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
  min-width: 0;
  color: #475569;
}

.helpdesk-ticket-meta-item i {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #64748b;
}

.helpdesk-ticket-meta-item span {
  min-width: 0;
  font-size: 0.81rem;
  font-weight: 600;
  line-height: 1.32;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.helpdesk-ticket-card.is-internal-task {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.92));
  border-color: rgba(14, 165, 233, 0.24);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card {
  border-color: rgba(71, 85, 105, 0.45);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.34);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card:hover {
  border-color: rgba(96, 165, 250, 0.34);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.46);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card .helpdesk-ticket-number,
:root[data-theme-mode="dark"] .helpdesk-ticket-head h4 {
  color: #f8fafc;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-meta-item i {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-meta-item span {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-priority-badge {
  border-color: rgba(71, 85, 105, 0.4);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-kind-badge {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(8, 47, 73, 0.78);
  color: #bae6fd;
}
.helpdesk-workspace-board {
  overflow: hidden;
}

/* As trilhas do grid do quadro sao definidas em design-system/layout.css
   (.tickets-board-page .board.helpdesk-board) — nao mexa aqui, esta regra
   perde por especificidade e por layer. */
.helpdesk-workspace-board .helpdesk-board {
  display: grid !important;
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
  gap: 0.6rem;
  align-items: start;
}

.helpdesk-workspace-board .helpdesk-column {
  min-width: 0 !important;
  width: 100%;
  flex: initial !important;
}

.helpdesk-workspace-board .helpdesk-column-list {
  min-width: 0;
}

/* 2026-04-01 Access control */
.access-shell .admin-page-hero {
    align-items: flex-start;
  }

/* 2026-04-11 Kanban column head refinement */
.helpdesk-workspace-board .helpdesk-board {
  align-items: stretch !important;
  grid-auto-rows: 1fr;
}

.helpdesk-workspace-board .helpdesk-column {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.82rem;
  border-radius: 24px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.helpdesk-workspace-board .helpdesk-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0;
  padding: 0.18rem 0.2rem 0.28rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: transparent;
  box-shadow: none;
}

.helpdesk-workspace-board .helpdesk-column-title-wrap {
  min-width: 0;
}

.helpdesk-workspace-board .helpdesk-column-head h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #111827;
}

.helpdesk-workspace-board .helpdesk-column-count {
  min-width: 2.55rem;
  height: 1.9rem;
  padding: 0 0.72rem;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
}

.helpdesk-workspace-board .helpdesk-column-list {
  gap: 0.7rem;
}

.helpdesk-workspace-board .helpdesk-column-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.15rem;
}

.helpdesk-workspace-board .helpdesk-column-load-more {
  width: 100%;
  justify-content: center;
  min-height: 2.7rem;
  border-radius: 1rem;
  font-weight: 700;
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  color: #334155;
}

@media (max-width: 1399.98px) {
  .helpdesk-workspace-board .helpdesk-column-head {
    padding: 0.15rem 0.1rem 0.1rem;
  }

  .helpdesk-workspace-board .helpdesk-column-head h3 {
    font-size: 0.92rem;
  }

  .helpdesk-workspace-board .helpdesk-column-count {
    min-width: 2.35rem;
    height: 1.8rem;
    font-size: 0.78rem;
  }
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-head {
  background: transparent;
  border-color: rgba(51, 65, 85, 0.72);
  box-shadow: none;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.38);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.32);
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-head h3 {
  color: #e5eefb !important;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-count {
  background: rgba(51, 65, 85, 0.9) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #e2e8f0 !important;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-load-more {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

.access-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.access-hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.access-hero-actions .btn i + span,
.access-hero-button i + span {
  margin-left: 0.55rem;
}

.access-shell-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.access-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.access-summary-card strong {
  display: block;
}

.access-toolbar-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 20px 40px rgba(15,23,42,0.08);
}

.access-toolbar-search {
  position: relative;
  min-width: min(420px, 100%);
  flex: 1;
}

.access-toolbar-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.access-toolbar-search input {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.26);
  padding: 0 1rem 0 2.7rem;
  background: #fff;
}

.access-entity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.access-entity-card {
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 24px 44px rgba(15,23,42,0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.access-entity-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.access-user-identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.access-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--color-primary-soft);
}

.access-user-identity h3,
.access-entity-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-text);
}

.access-user-identity p,
.access-entity-header p {
  margin: 0.2rem 0 0;
  color: var(--color-text-soft);
}

.access-entity-grid > .access-entity-card .access-entity-grid,
.access-entity-card .access-entity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.access-section-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.access-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.access-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
}

.access-pill.is-primary { background: rgba(37,99,235,0.12); color: #1d4ed8; }
.access-pill.is-secondary { background: rgba(51,65,85,0.1); color: #334155; }
.access-pill.is-success { background: rgba(16,185,129,0.14); color: #047857; }
.access-pill.is-warning { background: rgba(245,158,11,0.14); color: #b45309; }
.access-pill.is-danger { background: rgba(239,68,68,0.14); color: #b91c1c; }
.access-pill.is-muted { background: rgba(148,163,184,0.18); color: #475569; }
.access-pill.is-outline { background: transparent; color: #475569; border: 1px solid rgba(148,163,184,0.28); }

.access-empty-inline {
  color: #94a3b8;
  font-size: 0.9rem;
}

.access-entity-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.access-form-shell {
  gap: 1rem;
}

.access-user-core-grid {
  align-items: start;
}

.access-company-scope {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.access-company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.access-company-grid.is-disabled {
  opacity: 0.55;
}

.access-checkbox-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(255,255,255,0.86);
  cursor: pointer;
}

.access-checkbox-card input {
  margin-top: 0.2rem;
}

.access-checkbox-card span {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.access-checkbox-card small {
  color: #64748b;
}

.access-checkbox-card-inline {
  max-width: 720px;
}

.access-form-actions {
  justify-content: flex-end;
  gap: 0.75rem;
  padding-bottom: 1rem;
}

/* "Remover foto" (edicao de usuario e Meu perfil): botao de texto discreto,
   destrutivo. Seletor COMPOSTO (.access-compact-link.avatar-remove-btn) para
   vencer .access-compact-link -- mesma layer/especificidade, e o compact-link
   vem depois na fonte; sem o composto o botao virava pilula azul. */
.access-compact-link.avatar-remove-btn {
  background: transparent;
  color: var(--color-danger-text);
  font-weight: 700;
}

.access-compact-link.avatar-remove-btn:hover {
  background: transparent;
  color: var(--color-danger-text);
  text-decoration: underline;
}

/* Avatar do formulario de usuario: respiro abaixo (antes dos campos). Usa a base
   .profile-settings-avatar (centralizada). Classe -edit evita colidir com
   .access-user-avatar (miniatura 56x56 da LISTA de usuarios). */
.access-user-avatar-edit {
  margin: 0.5rem 0 1.5rem;
}

/* Card "Dados do usuario" em coluna: os campos distribuem na altura e ocupam o
   espaco vazio abaixo das senhas quando o card estica p/ acompanhar Empresas. */
#access-user-form > .settings-card:nth-of-type(1) {
  display: flex;
  flex-direction: column;
}

#access-user-form > .settings-card:nth-of-type(1) .access-user-core-grid {
  flex: 1 1 auto;
  align-content: space-between;
  row-gap: 1rem;
}

.access-user-matrix-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.access-user-matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.access-matrix-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.access-matrix-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.access-matrix-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.access-matrix-dot.is-inherited {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
}

.access-matrix-dot.is-allow {
  background: var(--color-success);
}

.access-matrix-dot.is-deny {
  background: var(--color-danger);
}

.access-matrix-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.access-matrix-legacy-warning {
  margin: 0;
}

.access-user-matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
}

.access-user-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  /* Colunas de acao repartem a folga igualmente; a de modulo tem largura
     fixa -- evita a 1a coluna "engolir" o espaco e deixa a matriz uniforme.
     min-width garante celulas usaveis: abaixo disso o .access-user-matrix-scroll
     rola na horizontal (nunca a pagina). */
  table-layout: fixed;
  min-width: 760px;
}

.access-user-matrix thead th {
  position: sticky;
  top: 0;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  padding: 0.7rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border-strong);
}

.access-user-matrix thead th:first-child {
  text-align: left;
  width: 300px;
}

.access-user-matrix tbody tr + tr td,
.access-user-matrix tbody tr + tr th {
  border-top: 1px solid var(--color-border-subtle);
}

.access-user-matrix tbody th[scope="row"] {
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-weight: 600;
  color: var(--color-text);
}

.access-user-matrix tbody th[scope="row"] strong {
  display: block;
  font-size: 0.88rem;
}

.access-user-matrix tbody th[scope="row"] small {
  display: block;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.74rem;
  margin-top: 0.1rem;
}

.access-user-matrix td {
  text-align: center;
  padding: 0.35rem 0.4rem;
}

/* Celula "nao se aplica" (acao inexistente no modulo): traco discreto em vez de
   vazio mudo. \2014 = travessao (fonte ASCII no source). Cor via token -> dark ok. */
.access-user-matrix td.access-matrix-empty::before {
  content: "\2014";
  color: var(--color-text-disabled);
  font-size: 0.9rem;
}

.access-matrix-cell {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-solid);
  color: var(--color-text-disabled);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.access-matrix-cell:hover {
  border-color: var(--color-border-focus);
}

.access-matrix-cell:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

.access-matrix-cell[data-permission-state="inherit"][data-permission-inherited="true"] {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-text);
}

.access-matrix-cell[data-permission-state="allow"] {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-success-fg);
}

.access-matrix-cell[data-permission-state="deny"] {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-danger-fg);
}

#access-user-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  justify-items: stretch;
  gap: 0.85rem;
}

#access-user-form > .settings-card {
  margin: 0;
  padding: 1rem;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  /* Destrava o teto de 620px de .settings-card-profile: aqui o card preenche
     a coluna do grid (cards 3 e 4 vao a 1/-1 = largura total). min-width:0
     permite o card encolher abaixo do conteudo (senao o min-width:auto do item
     de grid deixaria a matriz empurrar a pagina em telas estreitas -- e o
     .access-user-matrix-scroll que deve rolar, nunca a pagina). */
  width: 100%;
  max-width: none;
  min-width: 0;
}

#access-user-form > .settings-card:nth-of-type(n + 3) {
  min-height: 0;
}

#access-user-form > .settings-card:nth-of-type(1),
#access-user-form > .settings-card:nth-of-type(2) {
  grid-column: span 3;
}

#access-user-form > .settings-card:nth-of-type(3),
#access-user-form > .settings-card:nth-of-type(4) {
  grid-column: 1 / -1;
}

#access-user-form > .access-form-actions {
  grid-column: 1 / -1;
}

#access-user-form .settings-card-header {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Cabecalho (titulo + subtitulo) centralizado em todos os cards do formulario.
   Em Perfis, o botao "Gerenciar perfis" fica centralizado abaixo. Em Permissoes,
   a legenda/contador ficam FORA do header (na shell da matriz), sem conflito. */
#access-user-form > .settings-card > .settings-card-header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#access-user-form .settings-card-header h2,
#access-profile-form .settings-card-header h2 {
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#access-user-form .settings-card-header p,
#access-profile-form .settings-card-header p {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

#access-user-form .access-user-core-grid,
#access-profile-form .access-user-core-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 0.8rem;
}

#access-user-form .profile-field-block-full,
#access-profile-form .profile-field-block-full {
  grid-column: auto;
}

#access-user-form .settings-input,
#access-profile-form .settings-input {
  min-height: 42px;
}

.access-company-scope {
  gap: 0.65rem;
}

.access-company-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
}

.access-company-search {
  position: relative;
}

.access-company-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.82rem;
}

.access-company-search input {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 0 0.85rem 0 2.2rem;
  background: #fff;
  color: #0f172a;
}

.access-compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 0.75rem;
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.access-compact-link:hover {
  background: #2563eb;
  color: #fff;
}

.access-selection-count {
  color: #64748b;
  font-size: 0.8rem;
  white-space: nowrap;
}

.access-company-list {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.access-profile-picker {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
}

.access-checkbox-card {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
}

.access-checkbox-card strong {
  font-size: 0.86rem;
}

.access-checkbox-card small {
  font-size: 0.76rem;
}

.access-checkbox-card-inline {
  max-width: none;
}

.access-profile-toolbar {
  margin-bottom: 0.7rem;
  padding: 0.75rem;
}

.access-profile-matrix-shell {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.access-profile-matrix {
  max-height: calc(100vh - 340px);
  min-height: 260px;
  overflow: auto;
}

.access-profile-matrix-row {
  display: grid;
  grid-template-columns: var(--access-profile-columns);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
}

.access-profile-matrix-row:last-child {
  border-bottom: 0;
}

.access-profile-matrix-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.access-profile-matrix-head > div,
.access-profile-cell {
  padding: 0.7rem 0.8rem;
  border-right: 1px solid rgba(226, 232, 240, 0.86);
}

.access-profile-matrix-head > div:last-child,
.access-profile-cell:last-child {
  border-right: 0;
}

.access-profile-cell-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.access-profile-cell-main strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.access-profile-cell-main span,
.access-profile-cell-main small {
  color: #64748b;
  font-size: 0.76rem;
}

.access-profile-module-cell {
  display: grid;
  gap: 0.32rem;
  align-content: start;
}

.access-profile-permission {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 24px;
  color: #475569;
  font-size: 0.77rem;
  font-weight: 700;
}

.access-profile-permission i {
  width: 16px;
  height: 16px;
  /* Mesma pegadinha de .home-atalho i: CSS do kit da Font Awesome vem sem
     @layer e vence a layer, deixando o icone fora do centro do quadradinho. */
  --fa-display: inline-flex;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 0.62rem;
}

.access-profile-permission.is-allowed i {
  background: #2563eb;
  color: #fff;
}

.access-profile-permission.is-muted {
  color: #94a3b8;
}

.access-profile-permission.is-muted i {
  background: #e2e8f0;
  color: #94a3b8;
}

.access-profile-action-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.access-profile-matrix-row.is-dirty {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), var(--color-surface) 28%);
}

.access-profile-matrix-row.is-saved {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), var(--color-surface) 28%);
}

.access-profile-matrix-row.is-error {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), var(--color-surface) 28%);
}

.access-profile-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.18rem;
}

.access-profile-row-state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-profile-row-state.is-clean {
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
}

.access-profile-row-state.is-dirty {
  background: #fef3c7;
  color: #92400e;
}

.access-profile-row-state.is-saved {
  background: #dcfce7;
  color: #166534;
}

.access-profile-row-state.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.access-inline-input,
.access-inline-textarea,
.access-inline-select,
.access-mini-select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.access-inline-input,
.access-inline-select,
.access-mini-select {
  min-height: 32px;
  padding: 0.38rem 0.55rem;
}

.access-inline-textarea {
  min-height: 48px;
  resize: vertical;
  padding: 0.45rem 0.55rem;
  font-weight: 600;
  line-height: 1.25;
}

.access-inline-input:focus,
.access-inline-textarea:focus,
.access-inline-select:focus,
.access-mini-select:focus {
  background: var(--color-surface-solid);
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.access-profile-permission-toggle {
  cursor: pointer;
  user-select: none;
}

.access-profile-permission-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.access-profile-permission-toggle:hover span {
  color: #1d4ed8;
}

.access-profile-action-cell {
  flex-direction: column;
  align-items: stretch;
}

.access-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  width: 100%;
  min-height: 31px;
  font-weight: 800;
}

.access-save-button[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
}

.access-save-button.is-ready {
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.18);
}

.access-company-grid.access-company-list {
  grid-template-columns: 1fr;
}

:root[data-theme-mode="dark"] .access-toolbar-shell,
:root[data-theme-mode="dark"] .access-entity-card,
:root[data-theme-mode="dark"] .access-checkbox-card,
:root[data-theme-mode="dark"] .access-profile-matrix-shell,
:root[data-theme-mode="dark"] .access-profile-matrix-head {
  background: rgba(15,23,42,0.82);
  border-color: rgba(148,163,184,0.16);
  box-shadow: none;
}

:root[data-theme-mode="dark"] .access-user-identity h3,
:root[data-theme-mode="dark"] .access-entity-header h3,
:root[data-theme-mode="dark"] .access-profile-cell-main strong {
  color: #f8fafc;
}

:root[data-theme-mode="dark"] .access-user-identity p,
:root[data-theme-mode="dark"] .access-entity-header p,
:root[data-theme-mode="dark"] .access-section-label,
:root[data-theme-mode="dark"] .access-checkbox-card small,
:root[data-theme-mode="dark"] .access-empty-inline,
:root[data-theme-mode="dark"] .access-profile-cell-main span,
:root[data-theme-mode="dark"] .access-profile-cell-main small {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .access-toolbar-search input,
:root[data-theme-mode="dark"] .access-company-search input,
:root[data-theme-mode="dark"] .access-checkbox-card,
:root[data-theme-mode="dark"] .access-toolbar-shell {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .access-toolbar-search input {
  background: rgba(15,23,42,0.92);
  border-color: rgba(148,163,184,0.16);
}

/* Matriz de permissões usa tokens semânticos — o dark herda de tokens.css,
   sem overrides locais. */

@media (max-width: 1199.98px) {
  #access-user-form {
    grid-template-columns: 1fr;
  }

  #access-user-form > .settings-card:nth-of-type(1),
  #access-user-form > .settings-card:nth-of-type(2),
  #access-user-form > .settings-card:nth-of-type(3),
  #access-user-form > .settings-card:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .access-summary-grid,
  .access-company-grid,
  .access-entity-grid,
  .access-entity-card .access-entity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  #access-user-form .access-user-core-grid,
  #access-profile-form .access-user-core-grid,
  .access-company-toolbar {
    grid-template-columns: 1fr;
  }

  .access-summary-grid,
  .access-company-grid,
  .access-entity-grid,
  .access-entity-card .access-entity-grid {
    grid-template-columns: 1fr;
  }

  .access-entity-header,
  .access-hero-actions,
  .access-entity-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.helpdesk-ticket-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.helpdesk-ticket-actions-menu-shell {
  position: relative;
}

.helpdesk-ticket-actions-toggle {
  min-width: 150px;
}

/* Botoes do hero do ticket: usam ds-button--secondary do DS, sem overrides
   hardcoded. Em hero escuro o branco do secondary contrasta naturalmente. */

.helpdesk-ticket-actions-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 16px;
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.16);
  z-index: 40;
}

.helpdesk-ticket-actions-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
}

.helpdesk-ticket-actions-item.is-danger {
  background: #fff1f2;
  color: #be123c;
}

.helpdesk-ticket-actions-item:hover {
  background: #eff6ff;
}

.helpdesk-merge-results {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.helpdesk-merge-result-item {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
}

.helpdesk-merge-result-item.is-selected,
.helpdesk-merge-result-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.helpdesk-recurrence-form .app-modal-form-grid {
  margin-top: 8px;
}

.helpdesk-recurrence-radio-row,
.helpdesk-recurrence-radio-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.helpdesk-recurrence-radio-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .helpdesk-ticket-hero-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .helpdesk-ticket-actions-toggle,
  .helpdesk-ticket-hero-actions #helpdesk-back-board {
    flex: 1 1 180px;
  }

  .helpdesk-ticket-actions-menu {
    width: min(92vw, 280px);
  }

  .helpdesk-recurrence-radio-row {
    grid-template-columns: 1fr;
  }
}

:root[data-theme-mode="dark"] .helpdesk-ticket-actions-menu {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.6);
}

:root[data-theme-mode="dark"] .helpdesk-ticket-actions-item {
  background: #111c2e;
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-actions-item.is-danger {
  background: rgba(190, 24, 93, 0.16);
  color: #fda4af;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-actions-item:hover {
  background: #16263d;
}

:root[data-theme-mode="dark"] .helpdesk-merge-result-item {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .helpdesk-merge-result-item.is-selected,
:root[data-theme-mode="dark"] .helpdesk-merge-result-item:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.62);
}




/* 2026-04-08 SaaS admin and tenant subscription banner */
.tenant-subscription-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
  gap: 1rem;
  align-items: center;
  margin: 0 1.25rem 1rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--color-surface-raised);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.tenant-subscription-banner-copy,
.tenant-subscription-banner-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tenant-subscription-banner-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tenant-subscription-banner strong {
  color: var(--color-text);
  font-size: 1rem;
}

.tenant-subscription-banner p,
.tenant-subscription-banner small {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.5;
}

.tenant-subscription-banner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 800;
}

.tenant-subscription-banner.is-info {
  border-color: rgba(59, 130, 246, 0.22);
  background: var(--color-surface-raised);
}

.tenant-subscription-banner.is-warning,
.tenant-subscription-banner.is-warning-strong {
  border-color: rgba(245, 158, 11, 0.24);
  background: var(--color-surface-raised);
}

.tenant-subscription-banner.is-danger-soft,
.tenant-subscription-banner.is-danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: var(--color-surface-raised);
}

.tenant-subscription-inline-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--color-surface-raised);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.tenant-subscription-inline-copy,
.tenant-subscription-inline-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tenant-subscription-inline-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tenant-subscription-inline-banner strong {
  color: var(--color-text);
  font-size: 1rem;
}

.tenant-subscription-inline-banner p,
.tenant-subscription-inline-banner small {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.5;
}

.tenant-subscription-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 800;
}

.tenant-subscription-inline-banner.is-info {
  border-color: rgba(59, 130, 246, 0.22);
  background: var(--color-surface-raised);
}

.tenant-subscription-inline-banner.is-warning,
.tenant-subscription-inline-banner.is-warning-strong {
  border-color: rgba(245, 158, 11, 0.24);
  background: var(--color-surface-raised);
}

.tenant-subscription-inline-banner.is-danger-soft,
.tenant-subscription-inline-banner.is-danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: var(--color-surface-raised);
}

.tenant-subscription-readonly-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 1px dashed rgba(239, 68, 68, 0.24);
  background: var(--color-surface-raised);
}

.tenant-subscription-readonly-copy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tenant-subscription-readonly-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.tenant-subscription-readonly-icon {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.16), rgba(239, 68, 68, 0.14));
  color: #c2410c;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.16);
  flex-shrink: 0;
}

.tenant-subscription-readonly-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a3412;
}

.tenant-subscription-readonly-copy strong {
  color: #7c2d12;
  font-size: 1rem;
}

.tenant-subscription-readonly-copy p {
  margin: 0;
  color: #7c2d12;
  max-width: 70ch;
}

.tenant-subscription-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.tenant-subscription-readonly-panel {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--color-surface-raised);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
  min-height: 100%;
}

.tenant-subscription-readonly-panel span {
  display: inline-flex;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tenant-subscription-readonly-panel ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-text-soft);
}

.tenant-subscription-readonly-panel li + li {
  margin-top: 0.35rem;
}

.tenant-subscription-readonly-panel.is-blocked span {
  color: #b91c1c;
}

.tenant-subscription-readonly-panel.is-allowed span {
  color: #047857;
}

.tenant-subscription-readonly-footer {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-top: 0.1rem;
  color: #9a3412;
  font-size: 0.92rem;
}

.tenant-subscription-readonly-footer i {
  margin-top: 0.1rem;
  color: #ea580c;
}

@media (max-width: 900px) {
  .tenant-subscription-readonly-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tenant-subscription-readonly-card {
    padding: 0.95rem;
  }

  .tenant-subscription-readonly-head {
    gap: 0.75rem;
  }

  .tenant-subscription-readonly-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
  }
}


.tenant-blocked-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at top, rgba(37,99,235,0.12), transparent 38%), var(--color-surface-muted);
}

.tenant-blocked-card {
  width: min(760px, 100%);
  padding: 2rem;
  border-radius: 28px;
  border: 1px solid rgba(148,163,184,0.18);
  background: var(--color-surface-raised);
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.tenant-blocked-eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tenant-blocked-card h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 800;
}

.tenant-blocked-lead,
.tenant-blocked-card p,
.tenant-blocked-card li {
  color: var(--color-text-soft);
  line-height: 1.65;
}

.tenant-blocked-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tenant-blocked-meta {
  color: #b45309;
  font-weight: 700;
}

.tenant-blocked-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tenant-blocked-grid article {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--color-surface-muted);
  border: 1px solid rgba(148,163,184,0.18);
}

.tenant-blocked-grid strong {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--color-text);
}

.tenant-blocked-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .tenant-blocked-grid {
    grid-template-columns: 1fr;
  }

  .tenant-blocked-actions {
    flex-direction: column;
  }
}



/* 2026-04-10 Compact profile dropdown */
#profile-anchor.dropdown-menu {
  min-width: 192px;
  max-width: 192px;
  padding: 0.36rem;
  border-radius: 18px;
}

.dashboard-profile-summary {
  gap: 0.15rem;
  padding: 0.36rem 0.42rem 0.44rem;
}

.dashboard-profile-summary-label {
  font-size: 0.62rem;
  letter-spacing: 0.11em;
}

.dashboard-profile-summary strong {
  font-size: 0.84rem;
}

.dashboard-profile-summary small {
  font-size: 0.66rem;
}

#profile-anchor .dropdown-divider {
  margin: 0.28rem 0;
}

#profile-anchor .dropdown-item {
  gap: 0.58rem;
  min-height: 2.05rem;
  padding: 0.44rem 0.5rem;
  border-radius: 10px;
  font-size: 0.78rem;
}

#profile-anchor .dropdown-item i {
  width: 0.92rem;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .helpdesk-service-picker-panel {
    max-height: min(24rem, 52vh);
  }
}
/* Monitoring agent admin */
.monitoring-agent-workspace {
  gap: 1.25rem;
}

.monitoring-agent-hero {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
    var(--gradient-hero-accent);
  color: var(--color-hero-accent-text);
}

.monitoring-agent-hero p,
.monitoring-agent-hero h2 {
  color: inherit;
}

.monitoring-agent-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
}

.monitoring-agent-hero-actions .btn {
  min-height: 2.85rem;
  border-radius: 0.95rem;
  box-shadow: none;
}

.monitoring-agent-hero-actions .btn-outline-primary {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.monitoring-agent-hero-actions .btn-outline-primary:hover,
.monitoring-agent-hero-actions .btn-outline-primary:focus,
.monitoring-agent-hero-actions .btn-outline-primary:active {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(191, 219, 254, 0.38);
}

.monitoring-agent-hero-actions .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
}

.monitoring-agent-hero-actions .btn-primary:hover,
.monitoring-agent-hero-actions .btn-primary:focus,
.monitoring-agent-hero-actions .btn-primary:active {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: #1d4ed8;
}

.monitoring-agent-summary-strip .admin-summary-card {
  min-height: 132px;
}

.monitoring-agent-controls,
.monitoring-agent-downloads,
.monitoring-agent-empty,
.monitoring-agent-explainer {
  padding: 1.25rem;
}

.monitoring-agent-controls,
.monitoring-agent-downloads,
.monitoring-agent-card {
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px -32px rgba(15, 23, 42, 0.45);
}

.monitoring-agent-filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(360px, 2.7fr) minmax(220px, 0.9fr);
}

.monitoring-agent-filter-field {
  display: grid;
  gap: 0.5rem;
}

.monitoring-agent-filter-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.monitoring-agent-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.monitoring-agent-section-eyebrow {
  display: inline-flex;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.monitoring-agent-download-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-download-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: 1.1rem;
  background: var(--color-surface-muted);
}

.monitoring-agent-download-top {
  display: grid;
  gap: 0.5rem;
}

.monitoring-agent-download-top strong {
  font-size: 1.05rem;
}

.monitoring-agent-platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.monitoring-agent-platform-pill.is-windows {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.monitoring-agent-platform-pill.is-linux {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.monitoring-agent-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.monitoring-agent-explainer-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-explainer-grid div {
  display: grid;
  gap: 0.28rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-surface-muted);
}

.monitoring-agent-explainer-grid strong {
  color: var(--color-text);
  font-size: 0.92rem;
}

.monitoring-agent-explainer-grid span {
  color: var(--color-text-soft);
  font-size: 0.87rem;
  line-height: 1.45;
}

.monitoring-agent-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.monitoring-agent-download-actions .btn,
.monitoring-agent-card-actions .btn,
.monitoring-agent-empty .btn,
.monitoring-agent-secret-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  border-radius: 0.95rem;
}

.monitoring-agent-list {
  display: grid;
  gap: 1rem;
}

.monitoring-agent-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.monitoring-agent-list-head strong {
  font-size: 1.02rem;
}

.monitoring-agent-list-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-card {
  overflow: hidden;
  border-radius: 1.1rem;
}

.monitoring-agent-card .admin-entity-body {
  padding: 1rem 1rem 0.85rem;
}

.monitoring-agent-card .admin-entity-header {
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.monitoring-agent-card .admin-entity-icon {
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  font-size: 1.1rem;
}

.monitoring-agent-card .admin-entity-copy h3 {
  font-size: 0.98rem;
  line-height: 1.2;
  margin-bottom: 0.18rem;
}

.monitoring-agent-card .admin-entity-copy p {
  font-size: 0.74rem;
  line-height: 1.2;
  margin-bottom: 0;
}

.monitoring-agent-card .admin-info-row {
  padding-block: 0.45rem;
}

.monitoring-agent-card .admin-info-row span {
  font-size: 0.72rem;
  line-height: 1.15;
}

.monitoring-agent-card .admin-info-row strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.monitoring-agent-card-grid {
  display: grid;
  gap: 0.45rem 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-card .admin-entity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.monitoring-agent-card-topbadges,
.monitoring-agent-detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.monitoring-agent-scope-badge {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.monitoring-agent-card .admin-entity-badge.is-success {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.monitoring-agent-card .admin-entity-badge.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.monitoring-agent-card .admin-entity-badge.is-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.monitoring-agent-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  padding: 0 1rem 1rem;
}

.monitoring-agent-card-actions .btn {
  min-height: 2.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}

.monitoring-agent-card-actions .monitoring-agent-button-content {
  gap: 0.42rem;
}

.monitoring-agent-detail-panel {
  padding: 1.25rem;
}

.monitoring-agent-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.monitoring-agent-detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.monitoring-agent-detail-title-row .admin-entity-icon {
  width: 3.4rem;
  height: 3.4rem;
  min-width: 3.4rem;
}

.monitoring-agent-detail-title-row h3 {
  margin-bottom: 0.2rem;
  font-size: 1.15rem;
}

.monitoring-agent-detail-title-row p {
  margin-bottom: 0;
  color: #64748b;
}

.monitoring-agent-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.monitoring-agent-detail-actions .btn {
  min-height: 2.9rem;
  border-radius: 0.95rem;
}

.monitoring-agent-detail-grid {
  display: grid;
  gap: 0.6rem 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-detail-grid .admin-info-row {
  padding-block: 0.65rem;
}

.monitoring-agent-empty {
  justify-items: center;
  text-align: center;
}

.monitoring-agent-empty i {
  font-size: 2rem;
  color: #2563eb;
}

.monitoring-agent-form {
  display: grid;
  gap: 0.9rem;
  text-align: left;
  padding-top: 0.25rem;
}

.monitoring-agent-form label {
  display: grid;
  gap: 0.45rem;
}

.monitoring-agent-form label > span {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.monitoring-agent-form .form-control {
  min-height: 3rem;
  border-radius: 0.9rem;
}

.monitoring-agent-form .form-select {
  min-height: 3rem;
  border-radius: 0.9rem;
}

.monitoring-agent-multiselect {
  min-height: 9rem !important;
  padding-block: 0.45rem;
}

.monitoring-agent-form small {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.45;
}

.monitoring-agent-secret-modal {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.monitoring-agent-secret-block {
  display: grid;
  gap: 0.5rem;
}

.monitoring-agent-secret-block span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.monitoring-agent-secret-block code {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: #0f172a;
  color: #f8fafc;
  word-break: break-all;
}

.monitoring-agent-secret-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-agent-secret-grid div,
.monitoring-agent-secret-hint {
  display: grid;
  gap: 0.3rem;
}

.monitoring-agent-secret-actions,
.monitoring-agent-secret-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.monitoring-agent-install-block {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-surface-muted);
}

.monitoring-agent-install-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.monitoring-agent-install-head strong {
  font-size: 1.02rem;
}

.monitoring-agent-install-guide {
  display: grid;
  gap: 0.7rem;
}

.monitoring-agent-install-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.monitoring-agent-install-command {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.monitoring-agent-install-command code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: transparent;
  color: inherit;
  padding: 0;
}

.monitoring-agent-secret-extra {
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
}

.monitoring-agent-secret-extra summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

.monitoring-agent-secret-extra[open] summary {
  margin-bottom: 0.75rem;
}

.monitoring-coverage-summary {
  margin-bottom: 1rem;
}

.monitoring-coverage-lead,
.monitoring-coverage-allgood,
.monitoring-coverage-empty {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.monitoring-coverage-allgood {
  color: var(--color-text);
}

.monitoring-coverage-reason {
  border: 1px solid var(--color-border);
  border-radius: 0.8rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  background: var(--color-surface-muted);
}

.monitoring-coverage-reason summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.monitoring-coverage-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  border-radius: 0.6rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
  font-weight: 700;
  font-size: 0.85rem;
}

.monitoring-coverage-fix {
  margin: 0.6rem 0 0.5rem;
  font-size: 0.88rem;
  color: var(--color-text-soft);
}

.monitoring-coverage-device-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  max-height: 18rem;
  overflow-y: auto;
}

.monitoring-coverage-device-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: var(--color-surface-solid);
  font-size: 0.86rem;
}

.monitoring-coverage-device-list li span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.monitoring-coverage-device-list .monitoring-coverage-more {
  background: transparent;
  color: var(--color-text-muted);
  font-style: italic;
}

.monitoring-agent-swal {
  border-radius: 1.4rem;
  padding: 1.35rem 1.4rem 1.25rem;
}

.monitoring-agent-swal .swal2-title {
  font-size: 1.55rem;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 1rem;
}

.monitoring-agent-swal .swal2-html-container {
  margin: 0;
  padding: 0;
}

.monitoring-agent-swal .swal2-actions {
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.monitoring-agent-swal .swal2-actions .swal2-styled {
  margin: 0;
  min-height: 2.9rem;
  padding: 0.72rem 1.2rem;
  border-radius: 0.95rem;
  box-shadow: none;
  font-weight: 700;
}

.monitoring-agent-swal .swal2-confirm.monitoring-agent-swal-confirm {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f8fafc;
}

.monitoring-agent-swal .swal2-confirm.monitoring-agent-swal-confirm:hover,
.monitoring-agent-swal .swal2-confirm.monitoring-agent-swal-confirm:focus,
.monitoring-agent-swal .swal2-confirm.monitoring-agent-swal-confirm:active {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.monitoring-agent-swal .swal2-confirm.monitoring-agent-swal-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #f8fafc;
}

.monitoring-agent-swal .swal2-cancel.monitoring-agent-swal-cancel {
  background: #e2e8f0;
  color: #1e293b;
}

.monitoring-agent-swal--compact {
  max-width: 32rem;
}

@media (max-width: 991.98px) {
  .monitoring-agent-download-grid,
  .monitoring-agent-secret-grid,
  .monitoring-agent-filter-grid,
  .monitoring-agent-explainer-grid,
  .monitoring-agent-card-grid,
  .monitoring-agent-list-grid,
  .monitoring-agent-card-actions,
  .monitoring-agent-detail-grid {
    grid-template-columns: 1fr;
  }

  .monitoring-agent-detail-head {
    flex-direction: column;
  }

  .monitoring-agent-detail-actions,
  .monitoring-agent-card-topbadges,
  .monitoring-agent-detail-badges {
    justify-content: flex-start;
  }
}

/* Default chrome theme for NETZOR */
.dashboard-nav,
#company-locations-menu,
#company-locations-menu .dashboard-nav-dropdown,
#company-locations-menu .dashboard-nav-dropdown-menu {
  background: var(--custom-nav-bg, #0f172a) !important;
}

#ordered-root-nav,
#ordered-root-nav .dashboard-nav-root-item,
#ordered-root-nav .dashboard-nav-dropdown.show,
#ordered-root-nav .dashboard-nav-dropdown.bg-secondary,
#ordered-root-nav .dashboard-nav-dropdown-menu.bg-dark {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

.dashboard-toolbar {
  background: var(--custom-toolbar-bg, #111827) !important;
}

.container-footer,
.dashboard-footer {
  background: var(--custom-footer-bg, #0f172a) !important;
}

/* NETZOR theme hierarchy */
html,
body,
button,
input,
select,
textarea,
.swal2-popup,
.swal2-title,
.swal2-html-container {
  font-family: var(--font-sans) !important;
}

.brand-logo,
.dashboard-toolbar h1,
.dashboard-nav header,
.dashboard-nav-item,
.dashboard-nav-dropdown-toggle,
.dashboard-nav-dropdown-item,
.dashboard-brand-toggle,
.dashboard-store-toggle,
.dashboard-profile-summary strong,
.dashboard-profile-summary small,
#dashboard-button,
#admin-nav,
.container-footer,
.container-footer p,
#footer-brand-title {
  font-family: var(--font-display) !important;
}

.dashboard-nav,
#company-locations-menu,
#company-locations-menu .dashboard-nav-dropdown,
#company-locations-menu .dashboard-nav-dropdown-menu,
.dashboard-toolbar,
.container-footer,
.dashboard-footer {
  background-image: none !important;
}

.dashboard-nav-item,
.dashboard-nav-dropdown-item,
.dashboard-brand-toggle,
.dashboard-store-toggle,
#vpn .dashboard-nav-item,
#usCall .dashboard-nav-item,
#admin-nav {
  color: var(--custom-nav-text, #e5eefc) !important;
}

.dashboard-nav-item:hover,
.dashboard-nav-dropdown-item:hover,
.dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle,
.dashboard-nav-dropdown.show > .dashboard-nav-item,
#admin-nav:hover {
  background: var(--custom-nav-hover-bg, #1e293b) !important;
  color: #ffffff !important;
}

.dashboard-nav .dashboard-nav-dropdown-toggle:after {
  border-top-color: rgba(229, 238, 252, 0.74) !important;
}

#dashboard-button,
#profile-anchor {
  background-color: var(--custom-profile-button-bg, #2563eb) !important;
}

.container-footer p,
#footer-brand-title,
#footer-brand-subtitle,
#footer-brand-legal {
  color: #dbe7ff !important;
}

:root[data-theme-mode="netzor"] .dashboard,
:root[data-theme-mode="netzor"] body {
  background: #f4f7fb !important;
}

:root[data-theme-mode="netzor"] .dashboard-nav,
:root[data-theme-mode="netzor"] #company-locations-menu,
:root[data-theme-mode="netzor"] #company-locations-menu .dashboard-nav-dropdown,
:root[data-theme-mode="netzor"] #company-locations-menu .dashboard-nav-dropdown-menu {
  background: #0f172a !important;
  background-image: none !important;
}

:root[data-theme-mode="netzor"] #ordered-root-nav,
:root[data-theme-mode="netzor"] #ordered-root-nav .dashboard-nav-root-item,
:root[data-theme-mode="netzor"] #ordered-root-nav .dashboard-nav-dropdown.show,
:root[data-theme-mode="netzor"] #ordered-root-nav .dashboard-nav-dropdown.bg-secondary,
:root[data-theme-mode="netzor"] #ordered-root-nav .dashboard-nav-dropdown-menu.bg-dark {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

:root[data-theme-mode="netzor"] .dashboard-nav header {
  background: #111827 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: none !important;
  min-height: 60px !important;
  height: 60px !important;
  padding: 0rem 1rem !important;
}

:root[data-theme-mode="netzor"] .dashboard-toolbar {
  background: #111827 !important;
  background-image: none !important;
}

:root[data-theme-mode="netzor"] .container-footer,
:root[data-theme-mode="netzor"] .dashboard-footer {
  background: transparent !important;
  background-image: none !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: none !important;
  min-height: 72px !important;
}

:root[data-theme-mode="netzor"] .brand-copy,
:root[data-theme-mode="netzor"] .brand-copy strong,
:root[data-theme-mode="netzor"] .brand-copy small,
:root[data-theme-mode="netzor"] .brand-logo,
:root[data-theme-mode="netzor"] .dashboard-toolbar h1,
:root[data-theme-mode="netzor"] .dashboard-toolbar-title-fixed,
:root[data-theme-mode="netzor"] .dashboard-toolbar-title-fixed *,
:root[data-theme-mode="netzor"] .container-footer p,
:root[data-theme-mode="netzor"] #footer-brand-title,
:root[data-theme-mode="netzor"] #footer-brand-subtitle,
:root[data-theme-mode="netzor"] #footer-brand-legal {
  color: #f8fbff !important;
}

:root[data-theme-mode="netzor"] .brand-logo {
  width: 100% !important;
  max-width: 60% !important;
  min-height: 60px !important;
  height: 60px !important;
  padding: 0 !important;
  justify-content: center !important;
  align-items: center !important;
  align-self: stretch !important;
  display: inline-flex !important;
}

:root[data-theme-mode="netzor"] .brand-logo img {
  width: 100% !important;
  max-width: 220px !important;
  max-height: 60px !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  filter: none !important;
  opacity: 1 !important;
}

:root[data-theme-mode="netzor"] .footer-brand {
  background: #0f172a !important;
  border-radius: 14px !important;
  padding: 0.55rem 0.75rem !important;
  gap: 1rem !important;
}

:root[data-theme-mode="netzor"] .footer-brand-mark,
:root[data-theme-mode="netzor"] .container-footer .footer-brand-mark {
  width: 100px !important;
  height: 44px !important;
  padding: 0.1rem 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-theme-mode="netzor"] .footer-brand-mark img,
:root[data-theme-mode="netzor"] .container-footer .footer-brand-mark img,
:root[data-theme-mode="netzor"] .container-footer #footer-brand-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

:root[data-theme-mode="netzor"] .dashboard-brand-toggle,
:root[data-theme-mode="netzor"] .dashboard-store-toggle,
:root[data-theme-mode="netzor"] #admin-nav,
:root[data-theme-mode="netzor"] .dashboard-nav-item,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown-item,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle,
:root[data-theme-mode="netzor"] #vpn .dashboard-nav-item,
:root[data-theme-mode="netzor"] #usCall .dashboard-nav-item {
  color: #e5eefc !important;
  background: transparent !important;
  border-color: transparent !important;
}

:root[data-theme-mode="netzor"] .dashboard-brand-toggle:hover,
:root[data-theme-mode="netzor"] .dashboard-store-toggle:hover,
:root[data-theme-mode="netzor"] #admin-nav:hover,
:root[data-theme-mode="netzor"] .dashboard-nav-item:hover,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown-item:hover,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown.show > .dashboard-nav-dropdown-toggle,
:root[data-theme-mode="netzor"] #admin-nav.show {
  background: #1e293b !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

:root[data-theme-mode="netzor"] .dashboard-nav-dropdown-menu,
:root[data-theme-mode="netzor"] .dashboard-nav > .dashboard-nav-list > .dashboard-nav-dropdown > .dashboard-nav-dropdown-menu {
  background: transparent !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

:root[data-theme-mode="netzor"] .dashboard-nav .dashboard-nav-dropdown-toggle:after {
  border-top-color: rgba(229, 238, 252, 0.78) !important;
}

:root[data-theme-mode="netzor"] #dashboard-button,
:root[data-theme-mode="netzor"] #profile-anchor {
  background: #2563eb !important;
  background-image: none !important;
  color: #ffffff !important;
}

:root[data-theme-mode="netzor"] #profile-anchor.dropdown-menu,
:root[data-theme-mode="netzor"] #profile-anchor .dropdown-menu,
:root[data-theme-mode="netzor"] .dashboard-profile-summary,
:root[data-theme-mode="netzor"] .dashboard-profile-summary + .dropdown-divider,
:root[data-theme-mode="netzor"] #profile-anchor .dropdown-item {
  background: #111827 !important;
  color: #f8fbff !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}

:root[data-theme-mode="netzor"] #profile-anchor.dropdown-menu {
  text-align: center !important;
}

:root[data-theme-mode="netzor"] .dashboard-profile-summary {
  align-items: center !important;
  text-align: center !important;
  justify-content: center !important;
}

:root[data-theme-mode="netzor"] .dashboard-profile-summary-label,
:root[data-theme-mode="netzor"] .dashboard-profile-summary strong,
:root[data-theme-mode="netzor"] .dashboard-profile-summary small {
  width: 100%;
  text-align: center !important;
}

:root[data-theme-mode="netzor"] #profile-anchor .dropdown-item,
:root[data-theme-mode="netzor"] #profile-anchor li a {
  justify-content: center !important;
  text-align: center !important;
}

:root[data-theme-mode="netzor"] #profile-anchor .dropdown-item i,
:root[data-theme-mode="netzor"] #profile-anchor li a i {
  margin-right: 0.35rem !important;
}

:root[data-theme-mode="netzor"] #profile-anchor .dropdown-item:hover,
:root[data-theme-mode="netzor"] #profile-anchor .dropdown-item:focus {
  background: #1e293b !important;
  color: #ffffff !important;
}

:root[data-theme-mode="netzor"] body,
:root[data-theme-mode="netzor"] body button,
:root[data-theme-mode="netzor"] body input,
:root[data-theme-mode="netzor"] body select,
:root[data-theme-mode="netzor"] body textarea,
:root[data-theme-mode="netzor"] body .btn,
:root[data-theme-mode="netzor"] body .form-control,
:root[data-theme-mode="netzor"] body .form-select,
:root[data-theme-mode="netzor"] body .dropdown-menu,
:root[data-theme-mode="netzor"] body .card,
:root[data-theme-mode="netzor"] body .list-group-item {
  font-family: var(--font-sans) !important;
}

:root[data-theme-mode="netzor"] .brand-logo,
:root[data-theme-mode="netzor"] .brand-copy,
:root[data-theme-mode="netzor"] .brand-copy strong,
:root[data-theme-mode="netzor"] .dashboard-toolbar h1,
:root[data-theme-mode="netzor"] .dashboard-brand-toggle,
:root[data-theme-mode="netzor"] .dashboard-store-toggle,
:root[data-theme-mode="netzor"] .dashboard-nav-item,
:root[data-theme-mode="netzor"] .dashboard-nav-dropdown-item,
:root[data-theme-mode="netzor"] #admin-nav,
:root[data-theme-mode="netzor"] #dashboard-button,
:root[data-theme-mode="netzor"] #footer-brand-title {
  font-family: var(--font-display) !important;
}

.dashboard-nav-section-label {
  margin: 1rem 0 0.45rem;
  padding: 0 0.9rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.dashboard-nav-list > .dashboard-nav-section-label:first-of-type {
  margin-top: 0.4rem;
}

.settings-inline-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.settings-domain-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 0.9rem;
  background: var(--color-surface, #ffffff);
}

.settings-domain-panel[data-tone="success"] {
  border-top: 3px solid var(--color-success, #16a34a);
}

.settings-domain-panel[data-tone="danger"] {
  border-top: 3px solid var(--color-danger, #dc2626);
}

.settings-domain-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-domain-panel__title {
  font-size: 0.95rem;
  color: var(--color-text, #0f172a);
}

.settings-domain-panel__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.4rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-muted, #475569);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.settings-domain-panel__helper {
  margin: 0;
  line-height: 1.4;
}

.settings-domain-panel__input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.settings-domain-panel__input-row .settings-domain-panel__input {
  flex: 1;
  min-width: 0;
}

.settings-domain-panel__input-row .ds-button {
  flex-shrink: 0;
  white-space: nowrap;
}

.settings-domain-panel__feedback {
  min-height: 0;
  line-height: 1.3;
}

.settings-domain-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(203, 213, 225, 0.95);
  border-radius: 0.7rem;
  background: rgba(248, 250, 252, 0.6);
  max-height: 220px;
  overflow-y: auto;
}

.settings-domain-panel__empty {
  font-size: 0.8rem;
  color: var(--color-text-muted, #64748b);
  font-style: italic;
  align-self: center;
}

.settings-domain-chip {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.78rem;
  cursor: default;
}

.settings-domain-chip.ds-chip--success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.35);
  color: #166534;
}

.settings-domain-chip.ds-chip--danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
}

.settings-domain-chip:hover {
  background: inherit;
  border-color: currentColor;
}

.settings-domain-chip .ds-chip__remove {
  color: inherit;
}

.settings-domain-chip .ds-chip__remove:hover {
  background: rgba(15, 23, 42, 0.1);
}

.settings-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.settings-shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 16px 32px -28px rgba(15, 23, 42, 0.45);
}

.settings-shortcut-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.95rem;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 1rem;
}

.settings-shortcut-copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.settings-shortcut-copy > span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.settings-shortcut-copy > strong {
  font-size: 1rem;
  color: #0f172a;
}

.settings-shortcut-copy > p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.settings-navigation-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
  padding: 1.2rem;
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 16px 32px -28px rgba(15, 23, 42, 0.45);
}

.settings-navigation-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-navigation-panel-head h6 {
  font-size: 1rem;
  font-weight: 800;
}

.settings-navigation-panel-head p {
  max-width: 46ch;
}

.settings-navigation-panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-menu-order-list,
.settings-menu-order-board {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-menu-order-stack {
  display: grid;
  gap: 1rem;
}

.settings-menu-order-section {
  display: grid;
  gap: 0.7rem;
}

.settings-menu-order-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.settings-menu-order-section-head strong {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
}

.settings-menu-order-section-head small {
  color: #64748b;
  font-size: 0.8rem;
}

.settings-menu-order-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.82rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px -24px rgba(15, 23, 42, 0.52);
  cursor: grab;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.settings-menu-order-item:hover,
.settings-menu-order-item:focus-visible {
  border-color: rgba(59, 130, 246, 0.36);
  box-shadow: 0 18px 32px -22px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.settings-menu-order-item.is-dragging {
  opacity: 0.72;
  transform: scale(0.987);
  box-shadow: 0 22px 40px -26px rgba(15, 23, 42, 0.35);
  cursor: grabbing;
}

.settings-menu-order-item-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.9rem;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.95rem;
}

.settings-menu-order-item-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-menu-order-item-copy strong {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 800;
}

.settings-menu-order-item-copy span {
  color: #64748b;
  font-size: 0.84rem;
}

.settings-navigation-panel-title-light {
  color: #e2e8f0;
}

.settings-navigation-panel-copy-light {
  color: rgba(226, 232, 240, 0.84);
  max-width: 62ch;
}

.settings-navigation-panel-unified .form-check-label {
  color: rgba(226, 232, 240, 0.9);
  font-weight: 700;
}

.settings-unified-config-surface {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 1.15rem;
  background: var(--color-surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.settings-unified-config-surface .alert {
  border-radius: 0.95rem;
}

.settings-unified-empty-state {
  padding: 1rem;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 1rem;
  background: var(--color-surface-solid);
  color: var(--color-text-soft);
  font-size: 0.92rem;
}

.settings-unified-config-shell.is-disabled {
  opacity: 1;
}

.settings-unified-view-row {
  box-shadow: 0 12px 28px -26px rgba(15, 23, 42, 0.45);
}

.settings-unified-view-row .form-check-label {
  color: #334155;
}

/* Hover da linha de empresa na lista "Tela unificada" (Config → Navegação):
   base em style.css (@layer base) usa um azul-claro de hover → row ficava
   branca/clara no escuro. Tinte escuro sutil. Sem !important: base não tem
   !important e overrides > base. */
:root[data-theme-mode="dark"] .settings-unified-company-item:hover {
  border-color: var(--color-border-strong, var(--color-border));
  background: var(--color-surface-muted);
}

/* Labels dessas linhas têm cor cinza-escuro crua válida em todos os temas →
   ilegível no escuro. Flipa pro token de texto no escuro. */
:root[data-theme-mode="dark"] .settings-unified-view-row .form-check-label,
:root[data-theme-mode="dark"] .settings-navigation-panel-unified .form-check-label {
  color: var(--color-text);
}

:root[data-theme-mode="light"] .settings-navigation-panel-unified .form-check-label {
  color: #334155;
}

.dashboard-unified-views-dropdown > .dashboard-unified-views-menu {
  margin-top: 0.32rem;
  margin-left: 0.35rem;
  padding: 0.38rem 0.35rem 0.42rem 0.55rem;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(15, 23, 42, 0.045)) !important;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dashboard-nav-list-loading #company-locations-menu {
  min-height: 3rem;
}

.dashboard-nav-list-loading .dashboard-nav-loading {
  display: block;
}

:root[data-theme-mode="light"] .dashboard-unified-views-dropdown > .dashboard-unified-views-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.88)) !important;
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme-mode="netzor"] .dashboard-unified-views-dropdown > .dashboard-unified-views-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(15, 23, 42, 0.045)) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

:root[data-theme-mode="dark"] .dashboard-nav-section-label,
:root[data-theme-mode="netzor"] .dashboard-nav-section-label {
  color: rgba(148, 163, 184, 0.78);
}

:root[data-theme-mode="dark"] .settings-shortcut-card,
:root[data-theme-mode="netzor"] .settings-shortcut-card {
  border-color: rgba(51, 65, 85, 0.92);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.88));
  box-shadow: 0 18px 36px -28px rgba(2, 6, 23, 0.9);
}

:root[data-theme-mode="dark"] .settings-shortcut-copy > span,
:root[data-theme-mode="netzor"] .settings-shortcut-copy > span {
  color: rgba(148, 163, 184, 0.88);
}

:root[data-theme-mode="dark"] .settings-shortcut-copy > strong,
:root[data-theme-mode="netzor"] .settings-shortcut-copy > strong {
  color: #f8fafc;
}

:root[data-theme-mode="dark"] .settings-shortcut-copy > p,
:root[data-theme-mode="netzor"] .settings-shortcut-copy > p {
  color: rgba(226, 232, 240, 0.82);
}

:root[data-theme-mode="dark"] .settings-navigation-panel,
:root[data-theme-mode="netzor"] .settings-navigation-panel {
  border-color: rgba(51, 65, 85, 0.92);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.88));
  box-shadow: 0 18px 36px -28px rgba(2, 6, 23, 0.9);
}

:root[data-theme-mode="dark"] .settings-navigation-panel-head h6,
:root[data-theme-mode="netzor"] .settings-navigation-panel-head h6,
:root[data-theme-mode="dark"] .settings-menu-order-item-copy strong,
:root[data-theme-mode="netzor"] .settings-menu-order-item-copy strong,
:root[data-theme-mode="dark"] .settings-menu-order-section-head strong,
:root[data-theme-mode="netzor"] .settings-menu-order-section-head strong {
  color: #f8fafc;
}

:root[data-theme-mode="dark"] .settings-menu-order-item,
:root[data-theme-mode="netzor"] .settings-menu-order-item {
  border-color: rgba(71, 85, 105, 0.82);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.24);
}

:root[data-theme-mode="dark"] .settings-menu-order-item-copy span,
:root[data-theme-mode="netzor"] .settings-menu-order-item-copy span,
:root[data-theme-mode="dark"] .settings-menu-order-section-head small,
:root[data-theme-mode="netzor"] .settings-menu-order-section-head small {
  color: rgba(148, 163, 184, 0.9);
}

:root[data-theme-mode="dark"] .settings-navigation-panel-badge,
:root[data-theme-mode="netzor"] .settings-navigation-panel-badge {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .settings-menu-order-item-grip,
:root[data-theme-mode="netzor"] .settings-menu-order-item-grip {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

:root[data-theme-mode="light"] .settings-navigation-panel-title-light {
  color: #0f172a;
}

:root[data-theme-mode="light"] .settings-navigation-panel-copy-light {
  color: #475569;
}

/* === Premium Helpdesk Kanban refresh — command bar (DS tokens) === */
.helpdesk-workspace.helpdesk-workspace-board {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.helpdesk-board-command {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.helpdesk-board-command-copy {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.helpdesk-board-command-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  width: max-content;
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.helpdesk-board-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: var(--color-success);
  box-shadow: 0 0 0 4px var(--color-success-soft);
  animation: helpdesk-sync-pulse 2.4s ease-in-out infinite;
}

@keyframes helpdesk-sync-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.78; }
}

.helpdesk-board-command-copy strong {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.helpdesk-board-command-copy small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  color: var(--color-text-muted);
}

.helpdesk-board-command-side {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.helpdesk-board-stat-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
}

.helpdesk-board-stat-chip {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  min-width: 92px;
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-subtle);
  text-align: left;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.helpdesk-board-stat-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.helpdesk-board-stat-chip small {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-muted);
}

.helpdesk-board-stat-chip strong {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

.helpdesk-board-stat-chip.is-total      { background: var(--color-primary-soft); border-color: transparent; }
.helpdesk-board-stat-chip.is-total strong { color: var(--color-primary-text); }

.helpdesk-board-stat-chip.is-active     { background: var(--color-info-soft); border-color: transparent; }
.helpdesk-board-stat-chip.is-active strong { color: var(--color-info-text); }

.helpdesk-board-stat-chip.is-waiting    { background: var(--color-warning-soft); border-color: transparent; }
.helpdesk-board-stat-chip.is-waiting strong { color: var(--color-warning-text); }

.helpdesk-board-stat-chip.is-done       { background: var(--color-success-soft); border-color: transparent; }
.helpdesk-board-stat-chip.is-done strong { color: var(--color-success-text); }

@media (max-width: 768px) {
  .helpdesk-board-command {
    flex-direction: column;
    align-items: stretch;
  }

  .helpdesk-board-stat-row {
    overflow-x: auto;
    scrollbar-gutter: stable;
  }
}

.helpdesk-filter-grid.helpdesk-filter-grid-board {
  grid-template-columns: minmax(220px, 1.1fr) minmax(140px, 0.52fr) minmax(190px, 0.7fr) auto;
  gap: 0.72rem;
  align-items: end;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .helpdesk-filter-text,
.helpdesk-filter-grid.helpdesk-filter-grid-board .helpdesk-filter-number {
  grid-column: auto;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board > label {
  display: grid;
  gap: 0.36rem;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board > label > span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-input,
.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 24px rgba(15, 23, 42, 0.04);
}

.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-input:focus,
.helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-select:focus {
  border-color: rgba(59, 130, 246, 0.36);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.1),
    0 14px 28px rgba(37, 99, 235, 0.08);
}

.helpdesk-filter-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.helpdesk-ticket-card.is-client-filter-hidden {
  display: none !important;
}

.helpdesk-client-filter-empty {
  margin-top: 0.2rem;
}

.helpdesk-filter-actions .btn {
  min-height: 46px;
  border-radius: 14px;
  padding: 0.72rem 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: none;
}

.helpdesk-filter-actions .btn-outline-primary {
  border-color: rgba(59, 130, 246, 0.28);
  background: var(--color-surface);
  color: #1d4ed8;
}

.helpdesk-filter-actions .btn-outline-primary:hover,
.helpdesk-filter-actions .btn-outline-primary:focus,
.helpdesk-filter-actions .btn-outline-primary:active {
  border-color: rgba(37, 99, 235, 0.48) !important;
  background: var(--color-surface-muted) !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12) !important;
}

.helpdesk-filter-actions .btn-primary {
  border-color: rgba(37, 99, 235, 0.92);
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0ea5e9 100%);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.2);
}

.helpdesk-filter-actions .btn-primary:hover,
.helpdesk-filter-actions .btn-primary:focus,
.helpdesk-filter-actions .btn-primary:active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 55%, #0284c7 100%) !important;
  border-color: rgba(37, 99, 235, 0.98) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(37, 99, 235, 0.28) !important;
}

.helpdesk-workspace-board .helpdesk-board {
  gap: 0.85rem !important;
  align-items: stretch !important;
}

.helpdesk-workspace-board .helpdesk-column {
  position: relative;
  gap: 0.9rem !important;
  padding: 0.9rem !important;
  border-radius: 24px !important;
  border: 1px solid rgba(203, 213, 225, 0.92) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)) !important;
  box-shadow:
    0 20px 42px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
  overflow: hidden;
}

.helpdesk-workspace-board .helpdesk-column::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--helpdesk-column-accent, #94a3b8), rgba(255, 255, 255, 0));
}

.helpdesk-workspace-board .helpdesk-column[data-column-tone="backlog"] { --helpdesk-column-accent: #3b82f6; }
.helpdesk-workspace-board .helpdesk-column[data-column-tone="progress"] { --helpdesk-column-accent: #2563eb; }
.helpdesk-workspace-board .helpdesk-column[data-column-tone="waiting"] { --helpdesk-column-accent: #f59e0b; }
.helpdesk-workspace-board .helpdesk-column[data-column-tone="done"] { --helpdesk-column-accent: #10b981; }
.helpdesk-workspace-board .helpdesk-column[data-column-tone="archived"] { --helpdesk-column-accent: #64748b; }

.helpdesk-workspace-board .helpdesk-column-head {
  position: relative;
  align-items: flex-start !important;
  gap: 0.8rem !important;
  padding: 0.08rem 0 0.75rem !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
}

.helpdesk-workspace-board .helpdesk-column-head h3 {
  font-size: 1rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  color: #0f172a !important;
}

.helpdesk-workspace-board .helpdesk-column-head p {
  display: block !important;
  margin: 0.3rem 0 0 !important;
  color: #64748b !important;
  font-size: 0.79rem !important;
  line-height: 1.45 !important;
}

.helpdesk-workspace-board .helpdesk-column-count {
  min-width: 2.7rem !important;
  height: 2rem !important;
  padding: 0 0.78rem !important;
  border-radius: 999px !important;
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.helpdesk-workspace-board .helpdesk-column-list {
  gap: 0.82rem !important;
}

.helpdesk-ticket-card {
  gap: 0.82rem !important;
  min-height: 156px !important;
  padding: 0.95rem 1rem 0.92rem 1.02rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(226, 232, 240, 0.98) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96)) !important;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

.helpdesk-ticket-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  box-shadow:
    0 20px 36px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.helpdesk-ticket-card::before {
  left: 0.48rem !important;
  top: 0.85rem !important;
  bottom: 0.85rem !important;
  width: 4px !important;
  border-radius: 999px;
}

.helpdesk-ticket-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.helpdesk-ticket-card .helpdesk-ticket-number {
  margin-bottom: 0 !important;
  color: #64748b !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helpdesk-ticket-priority-badge,
.helpdesk-ticket-kind-badge {
  min-height: 1.8rem !important;
  padding: 0.22rem 0.64rem !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
}

.helpdesk-ticket-priority-badge {
  border: 1px solid rgba(226, 232, 240, 0.98) !important;
  background: rgba(248, 250, 252, 0.94) !important;
  color: #334155 !important;
}

.helpdesk-ticket-kind-badge {
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  background: rgba(224, 242, 254, 0.9) !important;
  color: #075985 !important;
}

.helpdesk-ticket-title-shell {
  display: grid;
  gap: 0.28rem;
}

.helpdesk-ticket-head h4 {
  font-size: 1rem !important;
  line-height: 1.32 !important;
  letter-spacing: -0.02em;
  color: #0f172a !important;
}

.helpdesk-ticket-context {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.helpdesk-ticket-meta {
  gap: 0.45rem !important;
}

.helpdesk-ticket-meta-item {
  grid-template-columns: 0.9rem minmax(0, 1fr) !important;
  gap: 0.52rem !important;
}

.helpdesk-ticket-meta-item i {
  color: #94a3b8 !important;
}

.helpdesk-ticket-meta-item span {
  font-size: 0.82rem !important;
  line-height: 1.34 !important;
  color: #475569 !important;
}

.helpdesk-ticket-card[data-assignment="unassigned"] .helpdesk-ticket-meta-item:last-child span {
  color: #c2410c !important;
}

.helpdesk-ticket-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.1rem;
}

.helpdesk-ticket-origin {
  gap: 0.38rem !important;
  min-height: 1.8rem;
  padding: 0.24rem 0.66rem !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  border: 1px solid transparent;
}

.helpdesk-ticket-origin i {
  font-size: 0.55rem;
}

.helpdesk-ticket-updated {
  margin-top: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  color: #94a3b8 !important;
}

.helpdesk-ticket-card.is-internal-task {
  border-color: rgba(125, 211, 252, 0.34) !important;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.92)) !important;
}

.helpdesk-column-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  text-align: center;
  min-height: 180px;
}

.helpdesk-column-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-xs);
  color: var(--color-neutral-500);
  font-size: 1.25rem;
}

.helpdesk-column-empty[data-empty-tone="terminal"] .helpdesk-column-empty-icon {
  background: var(--color-success-soft);
  border-color: transparent;
  color: var(--color-success-text);
}

.helpdesk-column-empty[data-empty-tone="active"] .helpdesk-column-empty-icon {
  background: var(--color-primary-soft);
  border-color: transparent;
  color: var(--color-primary-text);
}

.helpdesk-column-empty strong {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

/* === Helpdesk Kanban — Skeleton premium (shimmer) === */
@keyframes helpdesk-skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.helpdesk-skeleton-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-xs);
}

.helpdesk-skeleton-line,
.helpdesk-skeleton-pill {
  background: linear-gradient(
    90deg,
    var(--color-neutral-100) 0%,
    var(--color-neutral-50) 50%,
    var(--color-neutral-100) 100%
  );
  background-size: 200% 100%;
  animation: helpdesk-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 12px;
}

.helpdesk-skeleton-pill {
  width: 32px;
  height: 22px;
  border-radius: 999px;
}

.helpdesk-skeleton-line--xs { width: 28%; height: 10px; }
.helpdesk-skeleton-line--sm { width: 45%; height: 10px; }
.helpdesk-skeleton-line--md { width: 70%; }
.helpdesk-skeleton-line--lg { width: 92%; height: 14px; }
.helpdesk-skeleton-line--title { height: 18px; width: 220px; }
.helpdesk-skeleton-line--input { width: 320px; height: 32px; }

.helpdesk-skeleton-pill--button { width: 110px; height: 32px; border-radius: var(--radius-md); }
.helpdesk-skeleton-pill--field { width: 160px; height: 32px; border-radius: var(--radius-md); }
.helpdesk-skeleton-pill--metric { width: 88px; height: 32px; border-radius: var(--radius-pill); }

/* Skeleton do command bar (filter shell) */
.helpdesk-filter-shell-skeleton .command-bar__row {
  display: grid;
  align-items: center;
  min-width: 0;
}

.helpdesk-filter-shell-skeleton .command-bar__row--primary {
  grid-template-columns: minmax(220px, 0.64fr) minmax(620px, 1.36fr);
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5) var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
}

.helpdesk-filter-shell-skeleton .command-bar__row--secondary {
  grid-template-columns: minmax(440px, 0.95fr) minmax(430px, 1.05fr);
  gap: var(--space-4);
  padding: var(--space-2) var(--space-5);
}

.helpdesk-filter-shell-skeleton .command-bar__title-block {
  display: grid;
  gap: 6px;
}

.helpdesk-filter-shell-skeleton .command-bar__primary-actions {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto auto;
  gap: var(--space-2);
  align-items: center;
  justify-self: end;
  width: min(100%, 850px);
}

.helpdesk-filter-shell-skeleton .filter-bar__left {
  display: grid;
  grid-template-columns: minmax(128px, 0.5fr) minmax(184px, 0.72fr) auto auto;
  gap: var(--space-2);
  align-items: center;
  max-width: 520px;
}

.helpdesk-filter-shell-skeleton .command-bar__metrics.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, auto));
  justify-content: end;
  gap: var(--space-2);
}

[data-theme-mode="dark"] .helpdesk-skeleton-line,
[data-theme-mode="dark"] .helpdesk-skeleton-pill {
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.10) 0%,
    rgba(148, 163, 184, 0.18) 50%,
    rgba(148, 163, 184, 0.10) 100%
  );
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .helpdesk-skeleton-line,
  .helpdesk-skeleton-pill {
    animation: none;
  }
}

.helpdesk-column-list.is-drop-target {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(248, 250, 252, 0.4)) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.16);
}

.helpdesk-workspace-board .helpdesk-column-load-more {
  min-height: 2.85rem !important;
  border-radius: 16px !important;
  font-weight: 800 !important;
  border-color: rgba(203, 213, 225, 0.88) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)) !important;
  color: #334155 !important;
}

.helpdesk-workspace-board .helpdesk-column-load-more:hover,
.helpdesk-workspace-board .helpdesk-column-load-more:focus,
.helpdesk-workspace-board .helpdesk-column-load-more:active {
  border-color: rgba(37, 99, 235, 0.34) !important;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
  color: #1d4ed8 !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.08) !important;
}

:root[data-theme-mode="dark"] .helpdesk-filter-shell.helpdesk-filter-shell-premium {
  border-color: rgba(51, 65, 85, 0.84) !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96)) !important;
  box-shadow:
    0 22px 44px rgba(2, 6, 23, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

:root[data-theme-mode="dark"] .helpdesk-board-command-copy strong,
:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-head h3,
:root[data-theme-mode="dark"] .helpdesk-ticket-head h4 {
  color: #f8fafc !important;
}

:root[data-theme-mode="dark"] .helpdesk-board-command-copy small,
:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-head p,
:root[data-theme-mode="dark"] .helpdesk-ticket-context {
  color: #94a3b8 !important;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-count {
  color: #f8fafc !important;
}

:root[data-theme-mode="dark"] .helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-input,
:root[data-theme-mode="dark"] .helpdesk-filter-grid.helpdesk-filter-grid-board .inventory-filter-select {
  border-color: rgba(51, 65, 85, 0.84);
  background: rgba(15, 23, 42, 0.84);
  color: #e2e8f0;
  box-shadow: none;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column {
  border-color: rgba(51, 65, 85, 0.82) !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96)) !important;
  box-shadow:
    0 22px 42px rgba(2, 6, 23, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

:root[data-theme-mode="dark"] .helpdesk-workspace-board .helpdesk-column-head {
  border-color: rgba(51, 65, 85, 0.9) !important;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card {
  border-color: rgba(51, 65, 85, 0.88) !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96)) !important;
  box-shadow:
    0 16px 30px rgba(2, 6, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-card .helpdesk-ticket-number,
:root[data-theme-mode="dark"] .helpdesk-ticket-meta-item span,
:root[data-theme-mode="dark"] .helpdesk-ticket-updated {
  color: #cbd5e1 !important;
}

:root[data-theme-mode="dark"] .helpdesk-ticket-priority-badge {
  border-color: rgba(51, 65, 85, 0.88) !important;
  background: rgba(15, 23, 42, 0.84) !important;
  color: #e2e8f0 !important;
}

@media (max-width: 1199.98px) {
  .helpdesk-filter-grid.helpdesk-filter-grid-board {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  }

  .helpdesk-filter-grid.helpdesk-filter-grid-board > label:nth-of-type(3),
  .helpdesk-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 991.98px) {
  .helpdesk-filter-grid.helpdesk-filter-grid-board {
    grid-template-columns: 1fr;
  }

  .helpdesk-filter-actions {
    justify-content: stretch;
  }

  .helpdesk-filter-actions .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .helpdesk-workspace-board .helpdesk-board {
    grid-template-columns: 1fr !important;
    min-height: auto;
  }
}

/* ============================================================
 * Operação ao vivo (monitoring-operacao)
 * O visual da tela vive sob `.device-monitor-page` (CSS em layout.css);
 * aqui sobram só o pulse-dot do "Última atualização" e o trigger de help
 * compartilhado com a tela de receber equipamentos.
 * ========================================================== */
.monitoring-help-trigger {
  background: transparent;
  border: 0;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  margin-left: 0.4rem;
  font-size: 0.85rem;
  vertical-align: middle;
  transition: color 120ms ease;
}
.monitoring-help-trigger:hover { color: #38bdf8; }

.monitoring-operacao-pulse__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: monitoring-operacao-pulse 2s ease-out infinite;
}

@keyframes monitoring-operacao-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ============================================================
 * Operação: variante compacta para caber em telas de notebook.
 * Reduz alturas/paddings do hero, KPIs e filtros sem mexer na
 * tela tipada (Menu > Monitoramento > <dispositivo>).
 * ========================================================== */
.monitoring-operacao-shell.device-monitor-page .device-page-header {
  margin-bottom: 10px;
}
.monitoring-operacao-shell.device-monitor-page .device-page-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 18px;
}
.monitoring-operacao-shell.device-monitor-page .device-page-title-copy h1 {
  font-size: 24px;
}
.monitoring-operacao-shell.device-monitor-page .device-page-title-copy p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}
.monitoring-operacao-shell.device-monitor-page .device-page-action__primary {
  height: 36px;
  font-size: 12px;
}
.monitoring-operacao-shell.device-monitor-page .device-refresh-info {
  margin-top: 6px;
  font-size: 10.5px;
}
.monitoring-operacao-shell.device-monitor-page .device-kpi-grid {
  gap: 10px;
  margin-bottom: 10px;
}
.monitoring-operacao-shell.device-monitor-page .device-kpi-card {
  min-height: 78px;
  padding: 10px 14px;
  gap: 10px;
}
.monitoring-operacao-shell.device-monitor-page .device-kpi-card__icon {
  width: 36px;
  height: 36px;
}
/* Filter panel: nao mexer em min-height nem em .device-filter-field — eles
   sao stacks (label span + select). Forcar height comprime o select pra fora
   do container. So reduzimos margin-bottom. */
.monitoring-operacao-shell.device-monitor-page .device-filter-panel {
  margin-bottom: 10px;
}

/* ============================================================
 * Sidebar: garante contraste do hover. Layers com !important em
 * components/pages/utilities precisam ser vencidos. Especificidade
 * alta (html[data-theme-mode] body.dashboard-shell-locked .dashboard-nav ...)
 * + !important + alcance a TODOS os descendentes (texto + icone + spans
 * legacy do bootstrap link) garantem que nada herde o azul de
 * regras genericas como `<a>` link color do bootstrap.
 * ========================================================== */
html body .dashboard-nav .dashboard-nav-item:hover,
html body .dashboard-nav .dashboard-nav-item:hover *,
html body .dashboard-nav .dashboard-nav-dropdown-item:hover,
html body .dashboard-nav .dashboard-nav-dropdown-item:hover *,
html body .dashboard-nav .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover,
html body .dashboard-nav .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover *,
html body .dashboard-nav .dashboard-brand-toggle:hover,
html body .dashboard-nav .dashboard-brand-toggle:hover *,
html body .dashboard-nav .dashboard-store-toggle:hover,
html body .dashboard-nav .dashboard-store-toggle:hover * {
  color: #ffffff !important;
  fill: #ffffff !important;
}
html body .dashboard-nav .dashboard-nav-item:hover,
html body .dashboard-nav .dashboard-nav-dropdown-item:hover,
html body .dashboard-nav .dashboard-nav-dropdown > .dashboard-nav-dropdown-toggle:hover,
html body .dashboard-nav .dashboard-brand-toggle:hover,
html body .dashboard-nav .dashboard-store-toggle:hover {
  /* Hover precisa POP visualmente independente do navColor da tenant.
     Trajetoria: rgba(255,255,255,0.14) (sumia em sidebars azuis) ->
     #1e293b (indistinguivel de #0f172a) -> #334155 ainda sutil demais.
     Solucao final: bg mais escuro (#0b1426 deep navy) + ACCENT BAR
     branco solido 3px na esquerda. A barra branca e' indicador
     inequivoco de hover, nao depende de matiz de fundo. */
  background: rgba(0, 0, 0, 0.22) !important;
  box-shadow: inset 3px 0 0 0 #ffffff !important;
}

/* ============================================================
 * Dashboard de saude da plataforma (/saas-admin/health)
 * ========================================================== */
.saas-health-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.saas-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.saas-health-card { padding: 14px 16px; }
.saas-health-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: #53658a;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.saas-health-card header > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.saas-health-card__body {
  display: grid;
  gap: 8px;
}
.saas-health-stat { display: grid; gap: 1px; }
.saas-health-stat small { color: #66789b; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.saas-health-stat strong { color: #07164a; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }

.saas-health-section { padding: 14px 16px; }
.saas-health-section__head { margin-bottom: 10px; }
.saas-health-section__head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #07164a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.saas-health-section__head p {
  margin: 0;
  color: #53658a;
  font-size: 12px;
}

.saas-health-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}
.saas-health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.saas-health-table thead th {
  background: #f4f7fb;
  padding: 8px 12px;
  text-align: left;
  color: #53658a;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}
.saas-health-table tbody td {
  padding: 9px 12px;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  vertical-align: middle;
}
.saas-health-table code { font-size: 11.5px; }

.saas-health-config-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.saas-health-config-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--color-surface-muted);
  font-size: 12.5px;
}
.saas-health-config-list li > span:first-child {
  color: var(--color-text-soft);
  font-weight: 600;
}

.saas-health-logs-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.saas-health-logs-filters select { width: 220px; }
.saas-health-logs-table tbody td {
  font-size: 11.5px;
  padding: 6px 10px;
}
.saas-health-logs-table tbody td code { font-size: 10.5px; }

.saas-health-pulse--loading i.fa-rotate { animation: saas-health-spin 1s linear infinite; }
@keyframes saas-health-spin { to { transform: rotate(360deg); } }

.saas-health-footer {
  margin-top: 8px;
  text-align: center;
  color: #66789b;
  font-size: 11.5px;
}

/* ============================================================
 * Modal de latencia historica do device
 * ========================================================== */
.device-latency-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 22, 74, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  animation: device-latency-fade-in 180ms ease-out;
}
@keyframes device-latency-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.device-latency-modal {
  background: var(--color-surface-solid);
  border-radius: 14px;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}
.device-latency-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.device-latency-modal__eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-soft);
  font-weight: 700;
}
.device-latency-modal__header h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.025em;
}
.device-latency-modal__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.device-latency-modal__hours { width: 160px; }
.device-latency-modal__stats {
  display: flex;
  gap: 18px;
  padding: 12px 18px;
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.device-latency-modal__stats > span {
  display: grid;
  gap: 1px;
}
.device-latency-modal__stats small {
  color: var(--color-text-soft);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.device-latency-modal__stats strong {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
}
.device-latency-modal__chart-wrap {
  flex: 1 1 auto;
  min-height: 320px;
  padding: 14px 18px;
  position: relative;
}
.device-latency-modal__chart-wrap canvas {
  width: 100% !important;
  max-height: 380px;
}
.device-latency-modal__footer {
  margin: 0;
  padding: 8px 18px 14px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* --- Knowledge Base admin facelift (PR1 2026-05-30) --- */
.knowledge-admin-workspace {
  background: var(--color-surface-muted);
}

.knowledge-admin-section {
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: clamp(20px, 3vw, 28px);
  background: var(--color-surface-solid);
}

.knowledge-admin-section .helpdesk-admin-section-head {
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.knowledge-admin-section .helpdesk-admin-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.knowledge-admin-item {
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 16px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.knowledge-admin-item:hover {
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.knowledge-admin-item .helpdesk-admin-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.knowledge-hero-actions .ds-button--secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.knowledge-hero-actions .ds-button--secondary:hover {
  background: var(--color-surface-muted);
  border-color: #CBD5E1;
}

/* --- Knowledge Base welcome editor admin (PR2 2026-05-31) --- */

.knowledge-welcome-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knowledge-welcome-card .helpdesk-admin-section-head {
  align-items: flex-start;
}

/* Abas do card "Conteúdo do grupo": Boas-vindas | Atalhos do grupo | globais.
   Consolida 3 cards que empilhavam ~5 telas num só. */
.knowledge-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
}

.knowledge-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}

.knowledge-tab:hover {
  color: var(--color-text);
}

.knowledge-tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.knowledge-tab-panel {
  display: none;
}

.knowledge-tab-panel.is-active {
  display: block;
}

.knowledge-welcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.knowledge-welcome-dirty {
  color: #B45309;
  font-size: 13px;
  font-weight: 500;
}

/* Barra de contexto: seletor ÚNICO de grupo que rege a tela toda
   (artigos, navegação, boas-vindas, atalhos). Substitui os 3 seletores soltos. */
.knowledge-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: linear-gradient(120deg, var(--color-primary-soft) 0%, var(--color-surface) 70%);
}

.knowledge-context-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.knowledge-context-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.knowledge-context-picker .ds-select {
  min-width: 220px;
}

.knowledge-context-hint {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 13px;
}

/* Classes proprias (kb-*) do painel admin no lugar de generic-device-*
   emprestados: insula o KB de mudancas naquele modulo e ja tokeniza
   (dark-safe, sem cor crua). */
.knowledge-admin-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.knowledge-admin-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.knowledge-admin-filter-field > span {
  color: var(--color-text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-admin-filter-field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .knowledge-context-picker {
    width: 100%;
  }
  .knowledge-context-picker .ds-select {
    flex: 1;
    min-width: 0;
  }
}

.knowledge-welcome-picker {
  background: var(--color-surface-muted);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
}

.knowledge-welcome-picker label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}

.knowledge-welcome-picker label > span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.knowledge-welcome-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knowledge-welcome-shell {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  overflow: hidden;
}

.knowledge-welcome-shell .knowledge-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.knowledge-welcome-shell .knowledge-editor-toolbar button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: background-color 120ms;
}

.knowledge-welcome-shell .knowledge-editor-toolbar button:hover {
  background-color: var(--color-surface-muted);
}

.knowledge-welcome-shell .knowledge-editor-body {
  min-height: 160px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  outline: none;
}

.knowledge-welcome-shell .knowledge-editor-body:empty::before {
  content: attr(data-placeholder);
  color: #9CA3AF;
}

/* --- Knowledge Base welcome hero publico (PR2 2026-05-31) --- */

.knowledge-group-welcome-hero {
  display: flex;
  gap: 32px;
  align-items: center;
  padding: clamp(40px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 32px;
}

.knowledge-group-welcome-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knowledge-group-welcome-copy h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}

.knowledge-group-welcome-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text-soft);
}

.knowledge-group-welcome-body p {
  margin: 0 0 12px;
}

.knowledge-group-welcome-body a {
  color: var(--color-primary-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.knowledge-group-welcome-body ul,
.knowledge-group-welcome-body ol {
  margin: 0 0 12px 24px;
}

@media (max-width: 640px) {
  .knowledge-group-welcome-hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
  }
  .knowledge-group-welcome-copy h1 {
    font-size: 28px;
  }
}

/* --- Knowledge Base useful links admin (PR3 2026-05-31) --- */

.knowledge-link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.knowledge-link-search {
  width: 100%;
  margin-bottom: 12px;
}

.knowledge-link-card.is-hidden {
  display: none;
}

.knowledge-link-empty {
  margin-top: 4px;
}

.knowledge-link-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  transition: border-color 120ms, box-shadow 120ms;
}

.knowledge-link-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.knowledge-link-card.is-inactive {
  opacity: 0.6;
}

.knowledge-link-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  font-size: 18px;
  flex-shrink: 0;
}

.knowledge-link-card-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.knowledge-link-card-copy strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.knowledge-link-card-copy small {
  font-size: 13px;
  color: var(--color-text-muted);
}

.knowledge-link-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.knowledge-link-arrow {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background-color 120ms, color 120ms;
}

.knowledge-link-arrow:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

/* --- Knowledge Base icon picker (PR3 2026-05-31) --- */

.knowledge-icon-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.knowledge-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  background: var(--color-surface-muted);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.knowledge-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid transparent;
  background: var(--color-surface-solid);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}

.knowledge-icon-option:hover {
  border-color: #CBD5E1;
}

.knowledge-icon-option.is-selected {
  border-color: #6366F1;
  background-color: var(--color-primary-soft);
}

.knowledge-icon-option i {
  font-size: 20px;
  color: var(--color-text-soft);
}

.knowledge-icon-option span {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- Knowledge Base useful links publico (PR3 2026-05-31) --- */

.knowledge-public-useful-links,
.knowledge-group-useful-links {
  margin-top: clamp(40px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.knowledge-useful-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.knowledge-useful-section-head--global {
  margin-top: 16px;
}

.knowledge-useful-category-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin: 0 0 12px 0;
}

.knowledge-useful-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.knowledge-useful-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.knowledge-useful-card:hover {
  border-color: var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.knowledge-useful-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: #4F46E5;
  font-size: 16px;
  flex-shrink: 0;
}

.knowledge-useful-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.knowledge-useful-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.knowledge-useful-copy small {
  font-size: 13px;
  color: var(--color-text-soft);
}

@media (max-width: 640px) {
  .knowledge-useful-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-link-card-actions {
    flex-wrap: wrap;
  }
}

/* --- Knowledge Base PR4 polish (2026-05-31) --- */

/* Landing publica: hero suavizado (gradient claro) e descricao com contraste */
.knowledge-public-body .knowledge-public-hero {
  /* Gradiente sutil da marca (indigo-soft -> surface): dá presença e atmosfera
     sem sair do tema claro; adapta ao dark mode por ser 100% token. */
  background: linear-gradient(160deg, var(--color-primary-soft) 0%, var(--color-surface) 62%);
  border-radius: 22px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  margin-top: 8px;
  padding: clamp(36px, 5vw, 60px) clamp(20px, 3vw, 32px);
  /* visible (não hidden): o painel de autocomplete abre sob a barra e precisa
     ultrapassar o hero. O border-radius ainda recorta o fundo do card. */
  overflow: visible;
}

.knowledge-public-body .knowledge-public-hero h1 {
  font-size: clamp(22px, 2.8vw, 32px);
  margin: 8px 0 10px;
  line-height: 1.2;
}

.knowledge-public-body .knowledge-public-hero p {
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}

.knowledge-public-body .knowledge-public-hero .knowledge-search {
  margin: 20px auto 16px;
  max-width: 480px;
}

.knowledge-public-body .knowledge-public-hero .knowledge-search-shell {
  height: 48px;
}

.knowledge-public-body .knowledge-public-hero-meta {
  font-size: 13px;
}

.knowledge-public-body .knowledge-public-hero::before {
  display: none;
  content: none;
}

/* Glow de canto desligado: como o hero agora é overflow:visible (pro painel de
   busca poder ultrapassar), um glow ancorado fora do card vazaria pra fora das
   bordas arredondadas. O gradiente de fundo do hero já dá atmosfera suficiente. */
.knowledge-public-body .knowledge-public-hero::after {
  display: none;
  content: none;
}

.knowledge-public-body .knowledge-public-hero-copy h1 {
  color: transparent;
  background: linear-gradient(120deg, var(--color-text) 0%, var(--color-primary) 125%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.knowledge-public-body .knowledge-public-hero .knowledge-public-eyebrow {
  color: #4F46E5;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.knowledge-public-body .knowledge-public-hero h1 {
  background: linear-gradient(120deg, var(--color-text) 0%, var(--color-text-soft) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.knowledge-public-body .knowledge-public-hero p {
  color: var(--color-text-soft);
}

.knowledge-public-body .knowledge-public-hero-meta {
  color: var(--color-text-soft);
}

.knowledge-public-body .knowledge-public-hero-meta strong {
  color: var(--color-text);
}

/* Padding top do shell publico reduzido (era muito espacoso no topo) */
.knowledge-public-body .knowledge-public-shell {
  padding-top: clamp(12px, 2vw, 24px);
  padding-bottom: clamp(20px, 3vw, 40px);
}

.knowledge-public-body .knowledge-public-header {
  padding-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-brand {
  justify-self: start;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-brand img {
  height: 36px;
  width: auto;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4338CA;
  white-space: nowrap;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-color: rgba(99, 102, 241, 0.28);
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header i {
  font-size: 13px;
  color: #6366F1;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header > span {
  font-weight: 700;
  background: linear-gradient(120deg, #4338CA 0%, #6366F1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
}

.knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header {
    padding: 6px 12px;
    gap: 8px;
  }
  .knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header small {
    display: none;
  }
  .knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow-dot {
    display: none;
  }
}

/* Agrupa o botão de tema + o link (Entrar/Voltar) na coluna direita do header.
   O link .knowledge-public-login fica DENTRO deste wrapper (não é mais item
   direto do grid), então o alinhamento vive aqui. */
.knowledge-public-body .knowledge-public-header .knowledge-public-header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.knowledge-public-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  color: var(--color-text);
  font-size: 15px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.knowledge-public-theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.knowledge-public-theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .knowledge-public-body .knowledge-public-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand login"
      "eyebrow eyebrow";
    row-gap: 8px;
  }
  .knowledge-public-body .knowledge-public-header .knowledge-public-brand { grid-area: brand; }
  .knowledge-public-body .knowledge-public-header .knowledge-public-header-actions { grid-area: login; justify-self: end; }
  .knowledge-public-body .knowledge-public-header .knowledge-public-eyebrow--header { grid-area: eyebrow; justify-self: start; }
}

/* Hero compacto sem o paragrafo: alinhamento centralizado + busca proxima do h1 */
.knowledge-public-body .knowledge-public-hero {
  text-align: center;
}

.knowledge-public-body .knowledge-public-hero-copy {
  margin: 0 auto;
  max-width: 640px;
}

.knowledge-public-body .knowledge-public-hero-copy h1 {
  margin: 0 0 16px;
}

.knowledge-public-body .knowledge-public-hero .knowledge-search {
  margin: 0 auto 12px;
}

/* Cards de grupo na landing: tipografia + dimensoes mais compactas */
.knowledge-public-body .knowledge-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.knowledge-public-body .knowledge-group-card {
  min-height: auto;
  padding: 16px;
  gap: 12px;
  border-radius: 12px;
}

.knowledge-public-body .knowledge-group-card-brand {
  min-height: 88px;
  padding: 12px;
  border-radius: 12px;
}

.knowledge-public-body .knowledge-group-card-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.knowledge-public-body .knowledge-group-card-copy span {
  font-size: 13px;
  color: var(--color-text-soft);
}

.knowledge-public-body .knowledge-public-section-label {
  font-size: 11px;
}

.knowledge-public-body .knowledge-public-groups-head h2,
.knowledge-public-body .knowledge-public-useful-links h2 {
  font-size: clamp(18px, 2.2vw, 22px);
  margin-top: 4px;
}

/* Hero admin: dar contraste aos botoes secundarios sobre fundo escuro */
.knowledge-admin-workspace .helpdesk-hero {
  color: #FFFFFF;
}

.knowledge-hero-actions .ds-button--secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  backdrop-filter: blur(4px);
}

.knowledge-hero-actions .ds-button--secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
}

.knowledge-hero-actions .ds-button--secondary i,
.knowledge-hero-actions .ds-button--secondary span {
  color: #FFFFFF;
}

/* Welcome hero publico: mesma atmosfera de marca do hero da landing
   (gradiente indigo-soft -> surface + glow), pra pagina de grupo nao destoar. */
.knowledge-group-welcome-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-primary-soft) 0%, var(--color-surface) 62%);
  border-radius: 22px;
  padding: clamp(36px, 5vw, 56px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  align-items: center;
  margin-top: 24px;
  margin-bottom: 24px;
}

/* Glow de atmosfera no canto (decorativo, atras do conteudo). */
.knowledge-group-welcome-hero::after {
  content: "";
  position: absolute;
  inset: -70px -50px auto auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--color-primary-soft), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.knowledge-group-welcome-copy,
.knowledge-group-welcome-hero .knowledge-group-hero-brand {
  position: relative;
  z-index: 1;
}

.knowledge-group-welcome-copy .knowledge-public-eyebrow {
  color: #4F46E5;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.knowledge-group-welcome-copy h1 {
  background: linear-gradient(120deg, var(--color-text) 0%, var(--color-primary) 125%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.knowledge-group-welcome-body p {
  color: var(--color-text-soft);
}

.knowledge-group-hero-brand {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  max-width: 200px;
}

.knowledge-group-hero-brand img {
  max-width: 100%;
  display: block;
}

/* Grupo sem artigo publicado: estado "em construcao" (botoes reutilizam
   ds-button — nenhuma cor crua nova). */
.knowledge-group-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 24px;
  padding: clamp(32px, 5vw, 48px) 24px;
  border-radius: 20px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
  text-align: center;
}

.knowledge-group-coming-soon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.25rem;
}

.knowledge-group-coming-soon h2 {
  margin: 0.35rem 0 0;
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.knowledge-group-coming-soon p {
  margin: 0;
  max-width: 480px;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.knowledge-group-coming-soon-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

/* Header reduzido no topo (logo + voltar) com mais respiro */
.knowledge-public-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
}

/* Tela do artigo (sem hero gigante) -- breadcrumb + article-head no card */
.knowledge-group-body .knowledge-group-breadcrumbs {
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-soft);
}

.knowledge-group-breadcrumbs strong {
  color: var(--color-text);
}

.knowledge-article-head {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.knowledge-article-head h2 {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
  margin: 8px 0 12px;
}

.knowledge-article-chip {
  display: inline-block;
  background: var(--color-primary-soft);
  color: #4F46E5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.knowledge-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-soft);
}

/* Empty state visual + dashed border + icone */
.knowledge-link-list .admin-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  color: var(--color-text-soft);
  font-size: 14px;
  text-align: center;
}

.knowledge-link-list .admin-empty-state::before {
  content: "\f0c1";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 32px;
  color: var(--color-text-soft);
}

@media (max-width: 768px) {
  .knowledge-group-welcome-hero {
    padding: 24px;
    border-radius: 16px;
  }
  .knowledge-group-hero-brand {
    max-width: 120px;
  }
}

/* Painel "Artigos cadastrados": layout próprio (kb-owned) no lugar do
   monitoring-panel emprestado — full-width no grid + coluna vertical. */
.knowledge-articles-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  grid-column: 1 / -1;
}

/* Item 4 — container "Artigos cadastrados": grid full-width + lista de artigos */
.knowledge-articles-panel .helpdesk-filter-grid {
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
}

.knowledge-articles-registry {
  margin-top: 18px;
}

.knowledge-articles-registry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Rola DENTRO do card (~6 linhas visíveis) pra a lista longa não empurrar o
     container "Estrutura — Navegação e artigos" lá pra baixo. */
  max-height: 26rem;
  overflow-y: auto;
}

.knowledge-article-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
  transition: border-color 120ms, box-shadow 120ms;
}

.knowledge-article-row:hover {
  border-color: var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-sm);
}

.knowledge-article-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.knowledge-article-row-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-article-row-meta {
  font-size: 12px;
  color: var(--color-text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-article-status {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.knowledge-article-status.is-published {
  background: #DCFCE7;
  color: #047857;
}

.knowledge-article-status.is-draft {
  background: #FEF3C7;
  color: #B45309;
}

.knowledge-article-row-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.knowledge-article-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-solid);
  color: var(--color-text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.knowledge-article-action-btn:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong, var(--color-border));
}

.knowledge-article-action-btn--danger:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #B91C1C;
}

.knowledge-articles-empty {
  margin-top: 18px;
}

@media (max-width: 768px) {
  .knowledge-articles-panel .helpdesk-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .knowledge-article-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .knowledge-article-row-actions {
    width: 100%;
  }
  .knowledge-article-action-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Item 3 — "Por grupo": filtro de grupo dedicado + badge de grupo por card */
.knowledge-group-links-filterbar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.knowledge-group-links-select {
  flex: 0 0 30%;
  min-width: 150px;
}

.knowledge-group-links-search {
  flex: 1 1 auto;
  width: auto;
  margin-bottom: 0;
}

.knowledge-link-group-badge {
  background: #EEF2FF;
  color: #4338CA;
}

@media (max-width: 640px) {
  .knowledge-group-links-filterbar {
    flex-direction: column;
    align-items: stretch;
  }
  .knowledge-group-links-select {
    flex: 1 1 auto;
  }
}

/* Item 2 - editor rico (Chamados) na tela de artigo: ocupar a altura cheia */
.knowledge-editor-rich {
  flex: 1;
  min-height: calc(100vh - 360px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface-solid);
}

.knowledge-editor-rich .helpdesk-rich-editor-body.ql-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.knowledge-editor-rich .helpdesk-rich-editor-body .ql-editor {
  flex: 1;
  min-height: calc(100vh - 460px);
}

@media (max-width: 991.98px) {
  .knowledge-editor-rich {
    min-height: auto;
  }
  .knowledge-editor-rich .helpdesk-rich-editor-body .ql-editor {
    min-height: 240px;
  }
}

/* --- Base de conhecimento: publicos de leitura (aba "Publicos" + editor) ---
   Restricao de leitura por grupo de solicitantes. Só tokens do design system
   aqui: as cores precisam acompanhar [data-theme-mode] sem override manual. */
.knowledge-audience-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* `.ds-button` declara display:inline-flex e venceria o [hidden] da folha do
   agente: sem esta regra o "Novo publico" continuaria visivel no painel de
   membros (mesmo padrao ja usado em outros [hidden] do design system). */
.knowledge-audiences-card .ds-button[hidden] {
  display: none;
}

.knowledge-audience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.knowledge-audience-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-solid);
}

.knowledge-audience-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.knowledge-audience-copy strong {
  font-size: 14.5px;
  color: var(--color-text);
}

.knowledge-audience-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Membros: painel que substitui a lista dentro da propria aba (a lista de
   solicitantes e longa demais para um modal). */
.knowledge-audience-members {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knowledge-audience-members-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.knowledge-audience-members-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.knowledge-audience-members-copy strong {
  font-size: 16px;
  color: var(--color-text);
}

.knowledge-audience-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-muted);
}

.knowledge-audience-chips p {
  margin: 0;
}

.knowledge-audience-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  font-size: 12.5px;
  font-weight: 600;
}

.knowledge-audience-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.knowledge-audience-chip button:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

.knowledge-audience-search {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.knowledge-audience-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.knowledge-audience-results p {
  margin: 0;
}

.knowledge-audience-results-bulk {
  display: flex;
  justify-content: flex-end;
}

.knowledge-audience-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.knowledge-audience-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-solid);
}

.knowledge-audience-result.is-member {
  background: var(--color-surface-muted);
}

.knowledge-audience-result-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.knowledge-audience-result-copy strong {
  font-size: 13.5px;
  color: var(--color-text);
}

.knowledge-audience-result-copy small {
  font-size: 12px;
  color: var(--color-text-soft);
  overflow-wrap: anywhere;
}

/* Editor de artigo: "Quem pode ler" + checkboxes dos publicos vinculados. */
.knowledge-article-access {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knowledge-article-access [hidden] {
  display: none;
}

.knowledge-audience-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-muted);
}

.knowledge-audience-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
}

.knowledge-audience-check input {
  flex: 0 0 auto;
  margin: 0;
}

.knowledge-audience-empty {
  margin: 0;
}

/* Chip "restrito" na arvore e no registro de artigos — mesmo desenho dos chips
   "rascunho"/"Geral"/"desatualizado", com os tokens de danger (ja dark-safe). */
.knowledge-tree-chip.knowledge-tree-chip-restricted {
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

@media (max-width: 768px) {
  .knowledge-audience-search {
    grid-template-columns: minmax(0, 1fr);
  }
  .knowledge-audience-item {
    align-items: flex-start;
  }
  .knowledge-audience-actions {
    width: 100%;
  }
  .knowledge-audience-actions .ds-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ============================================================
   Inventario > Contratos — redesign denso em tabela (2026-06-10)
   ============================================================ */
.inventory-table-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Summary compacto (todas as telas de inventario) */
.inventory-summary-strip-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-top: 0;
}
.inventory-summary-strip-compact .inventory-summary-card {
  align-items: center;
  padding: 0.62rem 0.8rem;
  min-height: 0;
}
.inventory-summary-strip-compact .inventory-summary-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.92rem;
}
.inventory-summary-strip-compact .inventory-summary-card > div > strong { font-size: 0.62rem; }
.inventory-summary-strip-compact .inventory-summary-card > div > span { font-size: 1.18rem; margin-top: 0.1rem; }

/* Summary clicavel (filtra por status — usado em Contratos) */
.inventory-summary-card.is-clickable {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.inventory-summary-card.is-clickable:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.inventory-summary-card.is-clickable.is-active.tone-success { border-color: var(--color-success); box-shadow: var(--shadow-focus-success); }
.inventory-summary-card.is-clickable.is-active.tone-warning { border-color: var(--color-warning); box-shadow: var(--shadow-focus-warning); }
.inventory-summary-card.is-clickable.is-active.tone-danger { border-color: var(--color-danger); box-shadow: var(--shadow-focus-danger); }

/* Duas badges empilhadas numa celula (status + posse) */
.inventory-badge-stack { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Linha-filha (carta de correcao sob a NF pai) */
.inventory-row-sub > td:first-child { padding-left: 1.75rem; position: relative; }
.inventory-row-sub > td:first-child::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0;
  bottom: 50%;
  width: 1px;
  border-left: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
  width: 0.55rem;
}

/* Barra de filtros */
.inventory-contracts-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.85fr) minmax(0, 0.85fr) auto;
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-sm);
}
.inventory-contracts-filters .ds-form-group { gap: var(--space-1); }
.inventory-contracts-filters .ds-form-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inventory-filter-clear { align-self: end; height: 42px; white-space: nowrap; }

/* Tabela de contratos (DS .ds-table) */
.inventory-table.ds-table-responsive { box-shadow: var(--shadow-sm); }
.inventory-table .ds-table { background: transparent; }
.inventory-cell-primary { font-weight: 700; color: var(--color-text); }
.inventory-cell-sub { color: var(--color-text-soft); font-size: var(--font-size-xs); margin-top: 2px; }
.inventory-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1e40af;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.inventory-type-chip i { font-size: 0.85em; opacity: 0.85; }
.inventory-cell-nowrap { white-space: nowrap; }
.inventory-cell-arrow { color: var(--color-text-muted); margin: 0 0.3rem; }
.inventory-cell-muted { color: var(--color-text-muted); }
.inventory-attach-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  color: var(--color-text-soft);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-decoration: none;
}
a.inventory-attach-pill:hover { color: var(--color-primary); background: var(--color-primary-soft); }
.inventory-col-actions { width: 1%; text-align: right; white-space: nowrap; }
.inventory-row-actions { display: inline-flex; gap: var(--space-1); justify-content: flex-end; }
.inventory-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-solid);
  color: var(--color-text-soft);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.inventory-row-action:hover { color: var(--color-primary); border-color: var(--color-primary-200); background: var(--color-primary-soft); }
.inventory-row-action.is-danger:hover { color: var(--color-danger); border-color: var(--color-danger-200); background: var(--color-danger-soft); }

@media (max-width: 991.98px) {
  .inventory-contracts-filters {
    grid-template-columns: 1fr 1fr;
  }
  .inventory-filter-clear { grid-column: 1 / -1; justify-self: start; }
}

/* Editor de boas-vindas: mesmo editor rico dos Chamados, em altura de card (nao tela cheia) */
.knowledge-welcome-rich {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface-solid);
}

.knowledge-welcome-rich .helpdesk-rich-editor-body.ql-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.knowledge-welcome-rich .helpdesk-rich-editor-body .ql-editor {
  flex: 1;
  min-height: 220px;
}

/* ============================================================
   Assistente de importação de ativos — wizard 4 etapas
   Classes geradas por public/js/inventoryImportWizard.js
   ============================================================ */

/* Shell & body */
.inventory-import-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.inventory-import-body {
  width: 100%;
}

/* ----------------------------------------------------------
   Stepper horizontal (ol.inventory-import-steps)
   ---------------------------------------------------------- */
.inventory-import-steps {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.inventory-import-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  position: relative;
  min-width: 0;
}

/* Connector line between steps */
.inventory-import-step + .inventory-import-step::before {
  content: '';
  flex: 0 0 auto;
  width: 2rem;
  height: 2px;
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  margin-right: 0.55rem;
  transition: background var(--transition-fast);
}

.inventory-import-step.is-done + .inventory-import-step::before {
  background: var(--color-success);
}

.inventory-import-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-circle);
  border: 2px solid rgba(148, 163, 184, 0.30);
  background: var(--color-surface);
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.inventory-import-step.is-active .inventory-import-step-num {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.30);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.inventory-import-step.is-done .inventory-import-step-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}

.inventory-import-step-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.inventory-import-step.is-active .inventory-import-step-label {
  color: #1d4ed8;
}

.inventory-import-step.is-done .inventory-import-step-label {
  color: var(--color-success-text, #0e6f4b);
}

/* ----------------------------------------------------------
   Panel — card principal de cada etapa
   ---------------------------------------------------------- */
.inventory-import-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.6rem 1.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

/* ----------------------------------------------------------
   Intro (h2 + p no topo de cada etapa)
   ---------------------------------------------------------- */
.inventory-import-intro {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.inventory-import-intro h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.3rem, 1.7vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.inventory-import-intro p {
  margin: 0;
  color: #64748b;
  font-size: 0.94rem;
  line-height: 1.55;
  max-width: 72ch;
}

/* ----------------------------------------------------------
   Actions row (botão de baixar modelo, etc.)
   ---------------------------------------------------------- */
.inventory-import-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

/* ----------------------------------------------------------
   Footer — botões de ação (Cancelar / Voltar / Continuar)
   ---------------------------------------------------------- */
.inventory-import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   Etapa 1 — Dropzone
   ---------------------------------------------------------- */
.inventory-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.86);
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.inventory-import-dropzone:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(239, 246, 255, 0.92);
  box-shadow: var(--shadow-sm);
  color: #1d4ed8;
}

.inventory-import-dropzone i {
  font-size: 2.2rem;
  opacity: 0.70;
}

.inventory-import-dropzone strong {
  font-size: 0.96rem;
  font-weight: 700;
  color: #334155;
}

.inventory-import-dropzone small {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ----------------------------------------------------------
   Etapa 2 — Tabela de mapeamento de colunas
   ---------------------------------------------------------- */
.inventory-import-map-table {
  width: 100%;
}

.inventory-import-col-header {
  font-weight: 700;
  color: #334155;
  font-size: 0.9rem;
  vertical-align: middle;
}

.inventory-import-map-select {
  min-width: 200px;
}

.inventory-import-hint {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success-text, #0e6f4b);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

/* ----------------------------------------------------------
   Etapa 3 — Chips de resumo
   ---------------------------------------------------------- */
.inventory-import-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inventory-import-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.72rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.3;
}

.inventory-import-chip strong {
  font-weight: 800;
}

.inventory-import-chip.is-ok {
  background: var(--color-success-soft);
  color: var(--color-success-text, #0e6f4b);
  border-color: rgba(23, 166, 114, 0.18);
}

.inventory-import-chip.is-warn {
  background: var(--color-warning-soft);
  color: var(--color-warning-text, #875510);
  border-color: rgba(201, 131, 24, 0.18);
}

.inventory-import-chip.is-error {
  background: var(--color-danger-soft);
  color: var(--color-danger-text, #962839);
  border-color: rgba(212, 71, 92, 0.18);
}

.inventory-import-chip.is-skip {
  background: var(--color-neutral-bg);
  color: var(--color-neutral-fg, #334155);
  border-color: rgba(148, 163, 184, 0.18);
}

.inventory-import-chip.is-info {
  background: var(--color-info-soft);
  color: var(--color-info-text, #0c699a);
  border-color: rgba(54, 191, 255, 0.18);
}

/* ----------------------------------------------------------
   Etapa 3 — Filtro de checkbox
   ---------------------------------------------------------- */
.inventory-import-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.inventory-import-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ----------------------------------------------------------
   Etapa 3 — Tabela de revisão
   ---------------------------------------------------------- */
.inventory-import-review-table {
  width: 100%;
}

/* Status icon cell — narrow */
.inventory-import-status {
  width: 36px;
  text-align: center;
  vertical-align: middle;
  font-size: 1rem;
}

.inventory-import-rowlabel {
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
  vertical-align: middle;
}

.inventory-import-issues {
  color: #64748b;
  font-size: 0.84rem;
  vertical-align: middle;
}

.inventory-import-fixcell {
  vertical-align: middle;
  min-width: 160px;
}

.inventory-import-fix {
  max-width: 220px;
}

.inventory-import-fix-note {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
}

/* Row tints by status */
.inventory-import-row.is-ok td {
  background: rgba(23, 166, 114, 0.04);
  border-left: 0;
}

.inventory-import-row.is-ok td:first-child {
  border-left: 3px solid var(--color-success);
}

.inventory-import-row.is-warn td:first-child {
  border-left: 3px solid var(--color-warning);
}

.inventory-import-row.is-warn td {
  background: rgba(201, 131, 24, 0.04);
}

.inventory-import-row.is-error td:first-child {
  border-left: 3px solid var(--color-danger);
}

.inventory-import-row.is-error td {
  background: rgba(212, 71, 92, 0.04);
}

.inventory-import-row.is-skip td {
  background: rgba(148, 163, 184, 0.04);
  opacity: 0.72;
}

/* Células de dado (colunas-chave inline) */
.inventory-import-cell {
  font-size: 0.86rem;
  color: #334155;
  vertical-align: middle;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-import-cell-empresa {
  font-weight: 600;
}

/* Botão "Ver todos os campos" (expandir linha) */
.inventory-import-expandcell {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.inventory-import-expand {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.inventory-import-expand:hover {
  color: #475569;
  background: rgba(148, 163, 184, 0.12);
}

.inventory-import-expand.is-open {
  transform: rotate(180deg);
  color: #475569;
}

/* Linha de detalhe (campos restantes + observações da validação) */
.inventory-import-detail-row > td {
  padding: 0.5rem 0.9rem 0.9rem 2.4rem;
  background: rgba(148, 163, 184, 0.05);
}

.inventory-import-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 1.2rem;
  margin: 0;
}

.inventory-import-detail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inventory-import-detail-item dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #94a3b8;
  font-weight: 700;
}

.inventory-import-detail-item dd {
  margin: 0;
  font-size: 0.86rem;
  color: #334155;
  word-break: break-word;
}

.inventory-import-detail-issues {
  font-size: 0.84rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}

.inventory-import-detail-issues.is-error {
  background: var(--color-danger-soft);
  color: var(--color-danger-text, #962839);
}

.inventory-import-detail-issues.is-warn {
  background: var(--color-warning-soft);
  color: var(--color-warning-text, #875510);
}

.inventory-import-detail-issues.is-info {
  background: var(--color-info-soft);
  color: var(--color-info-text, #0c699a);
}

/* Stepper: etapas concluídas viram clicáveis (retroceder) */
.inventory-import-step.is-clickable {
  cursor: pointer;
}

.inventory-import-step.is-clickable:hover .inventory-import-step-label {
  text-decoration: underline;
}

/* Dark mode — detalhe + células */
:root[data-theme-mode="dark"] .inventory-import-cell,
:root[data-theme-mode="dark"] .inventory-import-detail-item dd {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-import-detail-row > td {
  background: rgba(148, 163, 184, 0.08);
}

/* Empty state cell */
.inventory-import-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
  font-size: 0.9rem;
  font-style: italic;
}

/* ----------------------------------------------------------
   Etapa 4 — Resultado
   ---------------------------------------------------------- */
.inventory-import-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 2rem 1rem;
  text-align: center;
}

.inventory-import-result-icon {
  font-size: 3rem;
  line-height: 1;
}

.inventory-import-result-icon.is-ok {
  color: var(--color-success);
}

.inventory-import-result-icon.is-warn {
  color: var(--color-warning);
}

.inventory-import-result h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 800;
}

.inventory-import-result p {
  margin: 0;
  color: #64748b;
  font-size: 0.96rem;
  max-width: 56ch;
}

/* Loading block (enquanto aguarda commit) */
.inventory-import-loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  text-align: center;
  color: #64748b;
}

.inventory-import-loading-block i {
  font-size: 2rem;
  color: #2563eb;
}

.inventory-import-loading-block p {
  margin: 0;
  font-size: 0.94rem;
}

/* ----------------------------------------------------------
   Dark mode overrides
   ---------------------------------------------------------- */
:root[data-theme-mode="dark"] .inventory-import-steps {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-import-step-label {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-import-step.is-active .inventory-import-step-label {
  color: #93c5fd;
}

:root[data-theme-mode="dark"] .inventory-import-step-num {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-import-panel {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme-mode="dark"] .inventory-import-intro h2,
:root[data-theme-mode="dark"] .inventory-import-result h2 {
  color: #e2e8f0;
}

:root[data-theme-mode="dark"] .inventory-import-intro p,
:root[data-theme-mode="dark"] .inventory-import-result p,
:root[data-theme-mode="dark"] .inventory-import-loading-block,
:root[data-theme-mode="dark"] .inventory-import-issues,
:root[data-theme-mode="dark"] .inventory-import-fix-note,
:root[data-theme-mode="dark"] .inventory-import-empty,
:root[data-theme-mode="dark"] .inventory-import-filter {
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-import-rowlabel {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-import-dropzone {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.42);
  color: #94a3b8;
}

:root[data-theme-mode="dark"] .inventory-import-dropzone strong {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-import-dropzone:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(96, 165, 250, 0.42);
  color: #bfdbfe;
}

:root[data-theme-mode="dark"] .inventory-import-col-header {
  color: #cbd5e1;
}

:root[data-theme-mode="dark"] .inventory-import-footer {
  border-top-color: rgba(71, 85, 105, 0.28);
}

:root[data-theme-mode="dark"] .inventory-import-loading-block i {
  color: #93c5fd;
}

:root[data-theme-mode="dark"] .inventory-import-row.is-ok td {
  background: rgba(23, 166, 114, 0.07);
}

:root[data-theme-mode="dark"] .inventory-import-row.is-warn td {
  background: rgba(201, 131, 24, 0.07);
}

:root[data-theme-mode="dark"] .inventory-import-row.is-error td {
  background: rgba(212, 71, 92, 0.07);
}

:root[data-theme-mode="dark"] .inventory-import-row.is-skip td {
  background: rgba(148, 163, 184, 0.06);
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 767.98px) {
  .inventory-import-steps {
    gap: 0;
    padding: 0.75rem 0.9rem;
  }

  .inventory-import-step + .inventory-import-step::before {
    width: 1rem;
    margin-right: 0.35rem;
  }

  .inventory-import-step-label {
    display: none;
  }

  .inventory-import-panel {
    padding: 1.1rem 1rem;
  }
}

/* === Compactacao do topo das telas de Inventario (2026-06-17) ==============
   Sobrescreve o bloco `.inventory-page-shell .*` (a partir de ~17535) que de
   fato controla a tela (maior especificidade que as regras de 1 classe).
   Hero mais baixo, cards menores, filtros numa linha (auto-fit) e menos
   espaco vertical. Append no fim do @layer overrides -> mesma especificidade
   das regras-alvo, vence por ordem de fonte. Sem regras forcadas (budget ok). */
.inventory-page-shell .inventory-summary-strip {
  margin-top: 0.5rem;
}
.inventory-page-shell .inventory-summary-card {
  min-height: 0;
  padding: 0.5rem 0.8rem;
}
.inventory-page-shell .inventory-filter-strip {
  margin-top: 0.5rem;
  padding: 0.7rem 0.9rem;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.inventory-page-shell .inventory-filter-strip .inventory-filter-input,
.inventory-page-shell .inventory-filter-strip .inventory-filter-select {
  min-height: 36px;
  padding: 0.34rem 0.7rem;
  font-size: 0.88rem;
}
.inventory-page-shell .inventory-filter-strip .inventory-filter-input::placeholder {
  font-size: 0.8rem;
}
.inventory-page-shell .inventory-toolbar-btn {
  min-height: 36px;
  padding: 0.42rem 0.85rem;
  border-radius: 11px;
  font-size: 0.86rem;
  box-shadow: none;
}
@media (min-width: 992px) {
  .inventory-page-shell .inventory-filter-strip {
    grid-template-columns: minmax(200px, 1.7fr) repeat(5, minmax(0, 1fr));
  }
}

/* ===== Toggle de tema no topbar (claro/escuro) + transição ===== */
.dashboard-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: var(--space-2);
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.dashboard-theme-toggle:hover {
  background: var(--color-neutral-bg);
  border-color: var(--color-text);
}

.dashboard-theme-toggle:active {
  transform: scale(0.94);
}

.dashboard-theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Transição suave aplicada só durante a troca de tema (classe transitória no <html>). */
html.theme-transition,
html.theme-transition body,
html.theme-transition * {
  transition: background-color 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  html.theme-transition,
  html.theme-transition body,
  html.theme-transition * {
    transition: none;
  }
}

} /* end @layer overrides */

/* ===========================================================================
   Base de Conhecimento — Central de Ajuda (landing pública redesenhada)
   Namespace kb-hub-* isolado da vista de grupo. 100% token nas superfícies
   (adapta ao modo escuro via data-theme-mode); hero/CTA navy são fixos nos dois
   temas por design (cores cruas intencionais — ver audit:css-dark-colors).
   =========================================================================== */
@layer overrides {
  /* ---- Tokens EXATOS do Claude Design handoff (reference-*.png / .dc.html) ----
     Redefinir os tokens padrão (--color-border, --color-text-muted, --shadow-sm)
     AQUI, escopado ao portal, alinha TODAS as superfícies (.knowledge-… e
     .kb-hub-…) de uma vez (borda/muted/sombra) sem reescrever regra por regra.
     Valores light já batem em bg/surface/text/soft (nz-ice-50, #fff, #101828,
     #66758a); só corrigimos border, muted e shadow. Os --kb-* bespoke cobrem o
     que não é token padrão (header-bg, chip-hover, accent).
     ATENÇÃO: nunca usar a sequência barra-asterisco dentro deste comentário —
     fecha o comentário cedo e descarta a regra de tokens abaixo. */
  .kb-hub-body,
  .kb-hub {
    --color-border: var(--nz-ice-150);            /* #e7eff8 (era ice-200, escuro demais) */
    /* neutral-400 (#94a3b8) dava só 2.6:1 no branco — reprova AA e deixava a
       contagem da navegação e a data do artigo quase apagadas. O 500 (#64748b)
       sobe pra 4.8:1 e continua lendo como texto secundário. */
    --color-text-muted: var(--nz-neutral-500);
    --shadow-sm: 0 2px 8px rgba(7, 17, 31, 0.05); /* sombra única suave do design */
    --kb-chip-bg: var(--nz-neutral-100);          /* #f1f5f9 */
    --kb-chip-hover: var(--nz-ice-150);           /* #e7eff8 */
    --kb-header-bg: rgba(255, 255, 255, 0.82);
    --kb-accent: var(--color-primary-500);        /* #1f5eff — 5.1:1 no branco */
    --kb-card-hover-shadow: 0 18px 40px rgba(7, 17, 31, 0.12);
  }
  [data-theme-mode="dark"] .kb-hub-body,
  [data-theme-mode="dark"] .kb-hub {
    --color-border: rgba(148, 163, 184, 0.16);
    --color-text: #f8fbff;
    --color-text-soft: #b4c4d8;
    --color-text-muted: #8296ad;
    --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.4);
    --kb-chip-bg: rgba(148, 163, 184, 0.12);
    --kb-chip-hover: rgba(148, 163, 184, 0.2);
    --kb-header-bg: rgba(11, 22, 40, 0.8);
    --kb-card-hover-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    /* O accent tinge o eyebrow ("ATALHOS ÚTEIS", "CATEGORIAS"), que é TEXTO e
       exige 4.5:1 — o primary-500 do tema claro dava só 3.3:1 aqui. A shade 300
       sobe pra 8:1 e mantém os ícones do accent bem visíveis. */
    --kb-accent: var(--color-primary-300);
  }

  /* O <body> do app base trava overflow (shell fixo) e é o elemento de canvas —
     estilizá-lo direto é instável entre temas. Aqui liberamos o scroll normal da
     página pública e deixamos o fundo pro wrapper .kb-hub abaixo. */
  .kb-hub-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--color-bg);
  }
  .kb-hub {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    /* Space Grotesk é a fonte do design (mesmo stack da landing de marketing);
       carregada via head.ejs quando publicThemeAuto. Fallback = sistema. */
    font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    /* Sem transição de background/cor no wrapper de página inteira: a troca de
       tema é instantânea (evita paint preso no valor antigo em alguns renderers). */
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
  }
  /* :where() zera a especificidade do reset — senão `.kb-hub a` (0,1,1) venceria
     as regras de cor dos botões (0,1,0), deixando o CTA com texto branco/invisível
     e o "Entrar" com a cor de texto herdada em vez de branca. */
  :where(.kb-hub) a { color: inherit; text-decoration: none; }

  /* ---- Header ---- */
  .kb-hub-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: var(--kb-header-bg);
    border-bottom: 1px solid var(--color-border);
  }
  .kb-hub-header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 28px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .kb-hub-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -.02em;
  }
  /* Marca do tenant = quadrado gradiente azul→ciano (ícone layers) + nome, como
     no design (reference-*.png). Valores exatos do .dc.html. */
  .kb-hub-brand-mark {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-secondary-400));
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(31, 94, 255, 0.35);
  }
  .kb-hub-brand-mark i { font-size: 15px; }
  .kb-hub-brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--color-text); white-space: nowrap; }
  /* Logo do tenant no cabeçalho, trocando por tema: a versão escura (loginLogo)
     no tema claro e a clara (primaryLogo) no escuro — senão um logo branco some
     sobre o header claro. */
  /* Altura da caixa = alvo visível / fração de conteúdo do PNG (medida no server,
     injetada inline em --kb-logo-frac). Assim o GLIFO tem ~28px de altura em
     QUALQUER logo/tenant/tema, independente do padding embutido no arquivo. O clamp
     evita extremos (logo muito "solto" não estoura o header; frac=1 de SVG ou de
     fallback → 28px, comportamento padrão). Compatível com qualquer tenant. */
  .kb-hub-brand-logo {
    height: clamp(24px, calc(28px / var(--kb-logo-frac, 1)), 44px);
    width: auto;
    max-width: 200px;
    object-fit: contain;
    object-position: left center;
    display: block;
  }
  .kb-hub-brand-logo--dark { display: none; }
  [data-theme-mode="dark"] .kb-hub-brand-logo--light { display: none; }
  [data-theme-mode="dark"] .kb-hub-brand-logo--dark { display: block; }
  /* Botão "Voltar" (empresa) = chip outline, não azul sólido (design). */
  .kb-hub-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 1px solid var(--color-border);
    background: var(--kb-chip-bg);
    color: var(--color-text);
    font-weight: 600;
    font-size: 14px;
    transition: background .2s ease, border-color .2s ease;
  }
  .kb-hub-back:hover { background: var(--kb-chip-hover); }
  .kb-hub-back i { font-size: 12px; }

  .kb-hub-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--kb-chip-bg);
    border: 1px solid var(--color-border);
    font-size: 12.5px;
    color: var(--color-text-soft);
  }
  .kb-hub-chip i { color: var(--kb-accent); }
  .kb-hub-chip-strong { font-weight: 600; color: var(--color-text); }
  .kb-hub-chip-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--color-text-muted); }

  .kb-hub-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
  .kb-hub-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    /* Azul da marca FIXO (#1f5eff) nos dois temas — o header é navy fixo. Usar
       var(--color-primary) deixaria o botão mais claro no escuro (primary-400). */
    background: var(--color-primary-500);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(31, 94, 255, 0.28);
    transition: background .2s ease, transform .2s ease;
  }
  /* A layer base marca o hover de link como importante e, para regras importantes,
     a ordem das layers INVERTE (base vence overrides) — então o texto do botão azul
     assumia a cor de link (ilegível no tema claro). Em vez de brigar, redefinimos a
     var --color-text-link-hover localmente: o hover continua branco nos dois temas. */
  .kb-hub-login { --color-text-link-hover: #fff; }
  .kb-hub-login:hover { background: var(--color-primary-600); transform: translateY(-1px); text-decoration: none; }
  .kb-hub-login i { font-size: 13px; }

  /* ---- Hero (navy fixo nos dois temas) ---- */
  .kb-hub-hero {
    position: relative;
    overflow: visible; /* deixa o dropdown de busca ultrapassar o hero */
    background: linear-gradient(150deg, var(--nz-navy-950) 0%, var(--nz-navy-800) 46%, var(--color-primary-700) 100%);
    color: #fff;
    /* SEM isolation/z-index no hero: isso criaria um contexto de empilhamento
       que prenderia o dropdown de busca ABAIXO dos cards de grupo (z-index:5).
       O hero-inner (z-index:6) fica acima dos cards, então o dropdown escapa. */
  }
  .kb-hub-hero-glow,
  .kb-hub-hero-grid { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
  .kb-hub-hero-glow {
    background:
      radial-gradient(680px 340px at 82% -8%, rgba(54, 191, 255, 0.32), transparent 60%),
      radial-gradient(560px 320px at 8% 118%, rgba(31, 94, 255, 0.34), transparent 62%);
  }
  .kb-hub-hero-grid {
    opacity: .4;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(680px 400px at 50% 0%, #000, transparent 78%);
    mask-image: radial-gradient(680px 400px at 50% 0%, #000, transparent 78%);
  }
  .kb-hub-hero-inner {
    position: relative;
    z-index: 6; /* acima de .kb-hub-groups-section (z-index:5) → dropdown por cima dos cards */
    max-width: 900px;
    margin: 0 auto;
    padding: 82px 28px 96px;
    text-align: center;
  }
  .kb-hub-hero-inner h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.03em;
  }
  .kb-hub-hero-inner > p {
    margin: 0 auto 38px;
    max-width: 540px;
    font-size: 17px;
    line-height: 1.55;
    color: rgba(226, 240, 255, 0.82);
  }

  /* ---- Busca (reusa o dropdown .knowledge-search-results + o JS existente) ---- */
  .kb-hub-searchbox { position: relative; z-index: 20; max-width: 640px; margin: 0 auto; }
  .kb-hub-searchbox-field {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 16px;
    padding: 6px 6px 6px 22px;
    box-shadow: 0 24px 60px rgba(4, 12, 28, 0.4);
  }
  .kb-hub-searchbox-field > i { color: #94a3b8; font-size: 17px; }
  .kb-hub-searchbox-field input {
    flex: 1;
    border: 0;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: #101828;
    padding: 14px 0;
  }
  .kb-hub-searchbox-field input::placeholder { color: #94a3b8; }
  .kb-hub-searchbox-field input::-webkit-search-decoration,
  .kb-hub-searchbox-field input::-webkit-search-cancel-button { appearance: none; -webkit-appearance: none; }
  /* Sem realce nativo do Chrome no input: o foco é mostrado no shell inteiro. */
  .kb-hub-searchbox-field input:focus,
  .kb-hub-searchbox-field input:focus-visible { outline: 0; box-shadow: none; }
  /* Anel de foco em volta da barra INTEIRA (por fora da borda), via :focus-within.
     Usa outline+offset (não box-shadow) pra não duplicar o rgba da sombra base. */
  .kb-hub-searchbox:focus-within .kb-hub-searchbox-field {
    outline: 3px solid color-mix(in srgb, var(--color-primary-500) 55%, transparent);
    outline-offset: 3px;
  }
  .kb-hub-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin-right: 4px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
  }

  /* ---- Populares (3 mais vistos) ---- */
  .kb-hub-popular { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; align-items: center; margin-top: 22px; }
  .kb-hub-popular-label { font-size: 13px; color: rgba(226, 240, 255, 0.6); }
  .kb-hub-popular-chip {
    font-size: 13px;
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: background .18s ease;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .kb-hub-popular-chip:hover { background: rgba(255, 255, 255, 0.2); }

  /* ---- Main ---- */
  .kb-hub-main { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

  /* ---- Empresas do grupo (sobem e sobrepõem o hero) ---- */
  .kb-hub-groups-section { position: relative; z-index: 5; margin-top: -44px; }
  .kb-hub-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
  @keyframes kbHubFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .kb-hub-group-card {
    display: block;
    background: var(--color-surface-solid);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    animation: kbHubFadeUp .5s ease var(--kb-delay, 0s) both;
  }
  .kb-hub-group-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--kb-card-hover-shadow);
    border-color: color-mix(in srgb, var(--color-primary-500) 40%, transparent);
  }
  /* Placa clara fixa nos dois temas pra o logo (geralmente colorido/escuro) aparecer. */
  .kb-hub-logo-frame {
    height: 118px;
    border-radius: 13px;
    background: #f1f4f9;
    border: 1px solid rgba(7, 17, 31, 0.06);
    overflow: hidden;
    padding: 20px;
    display: grid;
    place-items: center;
  }
  /* max-height FIXO em px (não %/100%): num grid a altura-% vira `auto`, a imagem
     segue o próprio aspecto, estoura a moldura e é cortada pelo overflow:hidden
     (ex.: logo 206x156 virava 177x134 numa área útil de 78px). Teto = altura da
     moldura menos padding (118 − 40 = 78) → o logo cabe INTEIRO e centralizado. */
  .kb-hub-logo-frame img { max-width: 100%; max-height: 78px; width: auto; height: auto; object-fit: contain; display: block; }
  .kb-hub-logo-fallback { color: #64748b; font-weight: 700; font-size: 18px; text-align: center; letter-spacing: -.01em; }
  .kb-hub-group-name { display: block; margin-top: 15px; font-size: 16px; letter-spacing: -.01em; }
  .kb-hub-group-count { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 13px; color: var(--color-text-muted); }
  .kb-hub-group-count i { font-size: 12px; }

  /* ---- Links úteis ---- */
  .kb-hub-links-section { margin-top: 64px; }
  .kb-hub-section-title { margin: 0 0 22px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
  .kb-hub-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .kb-hub-link-card {
    display: flex;
    /* flex-start (nao center): com descricao o card fica com duas linhas e o
       icone precisa ancorar no topo em vez de flutuar no meio. */
    align-items: flex-start;
    gap: 13px;
    background: var(--color-surface-solid);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, border-color .2s ease;
  }
  .kb-hub-link-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--color-primary-500) 40%, transparent); }
  .kb-hub-link-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--color-primary-500) 12%, transparent);
    color: var(--kb-accent);
  }
  .kb-hub-link-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .kb-hub-link-label { font-weight: 600; font-size: 14.5px; }
  .kb-hub-link-desc {
    font-size: 12.5px;
    line-height: 1.45;
    /* --color-text-soft (token com override no escuro), nao opacity: texto
       pequeno com opacity reprova o contraste AA. */
    color: var(--color-text-soft);
  }

  /* ---- CTA de chamado (navy fixo) ---- */
  .kb-hub-cta-section { margin: 64px 0 80px; }
  .kb-hub-cta {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--nz-navy-800), var(--color-primary-700));
    color: #fff;
    padding: 44px 48px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    box-shadow: 0 24px 60px rgba(18, 63, 183, 0.3);
  }
  .kb-hub-cta-glow {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 215, 255, 0.35), transparent 70%);
    pointer-events: none;
  }
  .kb-hub-cta-copy { position: relative; flex: 1; min-width: 260px; }
  .kb-hub-cta-copy h2 { margin: 0 0 8px; font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
  .kb-hub-cta-copy p { margin: 0; font-size: 15.5px; color: rgba(226, 240, 255, 0.85); line-height: 1.55; }
  .kb-hub-cta-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 13px;
    background: #fff;
    color: var(--color-primary-700);
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 12px 30px rgba(4, 12, 28, 0.3);
    transition: transform .2s ease;
  }
  .kb-hub-cta-btn:hover { transform: translateY(-2px); }

  /* ---- Footer ---- */
  .kb-hub-footer { border-top: 1px solid var(--color-border); background: var(--kb-header-bg); }
  .kb-hub-footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-text-muted);
  }
  .kb-hub-footer-brand { display: inline-flex; align-items: center; gap: 8px; }
  .kb-hub-footer-brand i { color: var(--kb-accent); }

  /* ---- Responsivo ---- */
  @media (max-width: 900px) {
    .kb-hub-groups { grid-template-columns: repeat(2, 1fr); }
    .kb-hub-links { grid-template-columns: repeat(2, 1fr); }
    .kb-hub-chip { display: none; }
    .kb-hub-hero-inner { padding: 60px 22px 72px; }
  }
  @media (max-width: 560px) {
    .kb-hub-groups { grid-template-columns: 1fr; }
    .kb-hub-links { grid-template-columns: 1fr; }
    .kb-hub-brand-name { display: none; }
    .kb-hub-cta { padding: 32px 26px; }
    .kb-hub-header-inner { padding: 0 18px; gap: 12px; }
    .kb-hub-main { padding: 0 18px; }
  }
} /* end @layer overrides (kb-hub) */

/* ===========================================================================
   Página da empresa (artigos/categorias) no estilo central de ajuda.
   Reusa o header/footer kb-hub; re-skina o conteúdo (markup + JS mantidos).
   Escopo .kb-hub-article-page (só a vista de grupo).
   =========================================================================== */
@layer overrides {
  .kb-hub-article-page .knowledge-public-shell {
    background: transparent;
    max-width: 1160px;
    margin: 0 auto;
    min-height: 0;
    padding: 28px;
    overflow: visible;
  }

  /* Busca da empresa → caixa de superfície + foco no shell inteiro (como a landing). */
  .kb-hub-article-page .knowledge-group-search { max-width: 760px; margin: 4px auto 30px; }
  .kb-hub-article-page .knowledge-search-field {
    background: var(--color-surface-solid);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }
  .kb-hub-article-page .knowledge-search-field:focus-within {
    outline: 3px solid color-mix(in srgb, var(--color-primary-500) 45%, transparent);
    outline-offset: 3px;
  }
  .kb-hub-article-page .knowledge-search-field input:focus,
  .kb-hub-article-page .knowledge-search-field input:focus-visible { outline: 0; box-shadow: none; }

  .kb-hub-article-page .knowledge-group-breadcrumbs { color: var(--color-text-muted); }

  /* ===== Welcome hero da empresa — classes DEDICADAS kb-hub-welcome-* (sem
     conflito com as regras antigas .knowledge-group-welcome-*). Fiel ao design:
     gradiente navy exato + glow + grade; placa branca do logo à direita; busca
     embutida. Navy fixo nos dois temas. ===== */
  .kb-hub-welcome {
    position: relative;
    overflow: visible; /* dropdown de busca escapa; glow/grid têm radius próprio */
    border-radius: 24px;
    margin-top: 22px;
    background: linear-gradient(150deg, #07111f 0%, #0f2447 46%, #123fb7 100%);
    color: #fff;
    padding: clamp(28px, 4vw, 52px);
    display: flex;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
  }
  .kb-hub-welcome-glow,
  .kb-hub-welcome-grid { position: absolute; inset: 0; pointer-events: none; border-radius: 24px; }
  .kb-hub-welcome-glow { background: radial-gradient(560px 300px at 88% -10%, rgba(54, 191, 255, 0.3), transparent 60%); }
  .kb-hub-welcome-grid {
    opacity: .4;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(600px 320px at 30% 0%, #000, transparent 76%);
    mask-image: radial-gradient(600px 320px at 30% 0%, #000, transparent 76%);
  }
  /* min-width:0 é o que impede o texto de estourar pra fora do card. */
  .kb-hub-welcome-copy { position: relative; z-index: 1; flex: 1 1 320px; min-width: 0; }
  .kb-hub-welcome-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
    padding: 6px 13px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #bfe0ff;
  }
  .kb-hub-welcome-title {
    margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; font-weight: 700;
    letter-spacing: -.03em; color: #fff;
  }
  .kb-hub-welcome-body { max-width: 520px; font-size: 16px; line-height: 1.6; }
  .kb-hub-welcome-subtitle { margin: 12px 0 0; }
  /* Força cor legível no corpo (o rich text do welcome pode ter cor inline escura). */
  .kb-hub-welcome-body,
  .kb-hub-welcome-body :where(p, span, li, div, strong, em, a, h2, h3) { color: rgba(226, 240, 255, 0.82) !important; }
  .kb-hub-welcome-body p { margin: 0 0 10px; }
  .kb-hub-welcome-body > :last-child { margin-bottom: 0; }
  .kb-hub-welcome-body a { text-decoration: underline; }
  /* Busca embutida (branca sobre o navy). */
  .kb-hub-welcome-search { position: relative; z-index: 2; max-width: 480px; margin-top: 26px; }
  .kb-hub-welcome-searchbar {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border-radius: 14px; padding: 5px 5px 5px 18px;
    box-shadow: 0 18px 44px rgba(4, 12, 28, 0.34);
  }
  .kb-hub-welcome-searchbar > i { color: #94a3b8; font-size: 16px; }
  .kb-hub-welcome-searchbar input {
    flex: 1; min-width: 0; border: 0; outline: 0; appearance: none; -webkit-appearance: none;
    background: transparent; font-family: inherit; font-size: 15px; color: #101828; padding: 13px 0;
  }
  .kb-hub-welcome-searchbar input::placeholder { color: #94a3b8; }
  .kb-hub-welcome-searchbar input:focus,
  .kb-hub-welcome-searchbar input:focus-visible { outline: 0; box-shadow: none; }
  .kb-hub-welcome-search:focus-within .kb-hub-welcome-searchbar { outline: 3px solid color-mix(in srgb, var(--color-primary-500) 45%, transparent); outline-offset: 3px; }
  .kb-hub-welcome-kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; margin-right: 4px;
    border-radius: 7px; background: #f1f5f9; color: #64748b; font-family: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid #e2e8f0;
  }
  /* Placa branca do logo do grupo (168x108) — img SEMPRE contida (não estoura). */
  .kb-hub-welcome-logo {
    position: relative; z-index: 1; flex: none;
    width: 168px; height: 108px; border-radius: 16px; background: #fff;
    display: grid; place-items: center; padding: 20px; box-shadow: 0 18px 44px rgba(4, 12, 28, 0.3);
  }
  /* max-height FIXO (não %): num grid, height/max-height:100% viram `auto` e um
     SVG quadrado (logo VW) se dimensiona pelo próprio aspecto (128x128) e estoura
     a placa. Teto fixo (108 − 40 de padding = 68) contém qualquer arte. */
  .kb-hub-welcome-logo img { max-width: 100%; max-height: 68px; object-fit: contain; display: block; }
  @media (max-width: 640px) { .kb-hub-welcome-logo { display: none; } }

  /* Cards → superfície kb-hub (borda/sombra do token; radius por tipo do design). */
  .kb-hub-article-page .knowledge-group-category-card,
  .kb-hub-article-page .knowledge-useful-card,
  .kb-hub-article-page .knowledge-article-related-card,
  .kb-hub-article-page .knowledge-category-article-card,
  .kb-hub-article-page .knowledge-group-article,
  .kb-hub-article-page .knowledge-group-nav {
    background: var(--color-surface-solid);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
  }
  /* Radius por tipo (design): categorias 18, atalhos/relacionados 14, artigo/nav 16. */
  .kb-hub-article-page .knowledge-group-category-card { border-radius: 18px; }
  .kb-hub-article-page .knowledge-useful-card,
  .kb-hub-article-page .knowledge-article-related-card,
  .kb-hub-article-page .knowledge-category-article-card { border-radius: 14px; }
  .kb-hub-article-page .knowledge-group-article,
  .kb-hub-article-page .knowledge-group-nav { border-radius: 16px; }

  .kb-hub-article-page .knowledge-group-category-card,
  .kb-hub-article-page .knowledge-useful-card,
  .kb-hub-article-page .knowledge-article-related-card,
  .kb-hub-article-page .knowledge-category-article-card {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  }
  .kb-hub-article-page .knowledge-group-category-card:hover,
  .kb-hub-article-page .knowledge-useful-card:hover,
  .kb-hub-article-page .knowledge-article-related-card:hover,
  .kb-hub-article-page .knowledge-category-article-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--color-primary-500) 40%, transparent);
    box-shadow: var(--kb-card-hover-shadow);
  }
  .kb-hub-article-page .knowledge-group-article { padding: clamp(20px, 3vw, 36px); }
  .kb-hub-article-page .knowledge-group-nav { padding: 18px; }

  /* ---- Seções (Atalhos úteis / Categorias): eyebrow + título ---- */
  .kb-hub-article-page .knowledge-useful-section-head,
  .kb-hub-article-page .knowledge-public-section-head { margin-bottom: 20px; }
  .kb-hub-article-page .knowledge-public-section-label {
    display: block; margin-bottom: 6px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--kb-accent);
  }
  .kb-hub-article-page .knowledge-group-section-title,
  .kb-hub-article-page .knowledge-useful-section-head h2 {
    margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--color-text);
  }
  /* Os atalhos agrupam por categoria (dado); rótulo do sub-grupo fica discreto. */
  .kb-hub-article-page .knowledge-useful-category + .knowledge-useful-category { margin-top: 14px; }
  .kb-hub-article-page .knowledge-useful-category-head {
    margin: 0 0 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--color-text-muted);
  }

  /* ---- Grids 3 colunas ---- */
  .kb-hub-article-page .knowledge-group-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .kb-hub-article-page .knowledge-useful-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

  /* ---- Card de atalho (linha: ícone + copy) ---- */
  .kb-hub-article-page .knowledge-useful-card { display: flex; align-items: center; gap: 13px; padding: 16px 18px; }
  .kb-hub-article-page .knowledge-useful-icon {
    flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 15px;
    background: color-mix(in srgb, var(--color-primary-500) 10%, transparent); color: var(--kb-accent);
  }
  .kb-hub-article-page .knowledge-useful-copy strong { display: block; font-size: 14.5px; letter-spacing: -.01em; color: var(--color-text); }
  .kb-hub-article-page .knowledge-useful-copy small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--color-text-soft); }

  /* ---- Card de categoria (coluna: ícone, título, descrição, contagem) ---- */
  .kb-hub-article-page .knowledge-group-category-card { display: block; padding: 24px; }
  .kb-hub-article-page .knowledge-group-category-icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 19px;
    background: color-mix(in srgb, var(--color-primary-500) 10%, transparent); color: var(--kb-accent);
  }
  .kb-hub-article-page .knowledge-group-category-card > strong { display: block; margin-top: 16px; font-size: 16.5px; letter-spacing: -.01em; color: var(--color-text); }
  .kb-hub-article-page .knowledge-group-category-card > small { display: block; margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--color-text-soft); }
  .kb-hub-article-page .knowledge-group-category-count {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--color-text-muted);
  }
  .kb-hub-article-page .knowledge-group-category-count i { font-size: 11px; }

  /* ============ Layout persistente: Navegação à ESQUERDA + conteúdo à direita.
     A navegação fica visível em TODAS as vistas da empresa (landing/artigo/
     categoria), não só ao abrir um artigo. ============ */
  .kb-hub-article-page .knowledge-group-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin-top: 28px;
  }
  .kb-hub-article-page .knowledge-group-layout > * { min-width: 0; }
  .kb-hub-article-page .knowledge-group-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 48px;
  }
  .kb-hub-article-page .knowledge-group-main > * { margin: 0; }

  /* Anti-overflow (vale pra TODA a base): URLs/tokens longos em títulos, TOC, nav,
     breadcrumb e corpo QUEBRAM em vez de vazar do card. overflow-wrap:anywhere
     também reduz o min-content, então não força a coluna do grid a estourar. */
  .kb-hub { overflow-wrap: break-word; }
  .kb-hub-article-page .knowledge-article-toc-link,
  .kb-hub-article-page .knowledge-group-menu a,
  .kb-hub-article-page .knowledge-group-menu-category,
  .kb-hub-article-page .knowledge-group-menu-sub-label,
  .kb-hub-article-page .knowledge-group-menu-sub-summary,
  .kb-hub-article-page .knowledge-article-body,
  .kb-hub-article-page .knowledge-group-breadcrumbs { overflow-wrap: anywhere; }

  /* ============ Detalhes da vista de artigo ============ */
  /* Chip de categoria = pílula azul clara. */
  .kb-hub-article-page .knowledge-article-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
    /* O 500 é a base do papel, não o texto: sobre a pílula translúcida no modo
       escuro dava 3.2:1. O token de texto acompanha o tema. */
    background: color-mix(in srgb, var(--color-primary-500) 10%, transparent); color: var(--color-primary-text);
    font-size: 12.5px; font-weight: 600;
  }
  .kb-hub-article-page .knowledge-article-head h2 {
    margin: 16px 0 14px; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: var(--color-text);
  }
  .kb-hub-article-page .knowledge-article-meta {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted);
  }
  .kb-hub-article-page .knowledge-article-meta strong { color: var(--color-text-soft); font-weight: 600; }
  .kb-hub-article-page .knowledge-article-head > p {
    margin: 18px 0 0; font-size: 17px; line-height: 1.6; color: var(--color-text-soft);
  }
  /* Divisória entre cabeçalho e corpo + tipografia do corpo (design). */
  .kb-hub-article-page .knowledge-article-body {
    margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--color-border);
    font-size: 16px; line-height: 1.7; color: var(--color-text);
  }
  .kb-hub-article-page .knowledge-article-body h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 34px 0 12px; }
  .kb-hub-article-page .knowledge-article-body p { margin: 0 0 18px; }
  .kb-hub-article-page .knowledge-article-body ul,
  .kb-hub-article-page .knowledge-article-body ol { margin: 0 0 18px; padding-left: 22px; }
  .kb-hub-article-page .knowledge-article-body li { margin-bottom: 8px; }

  /* Anexos. */
  .kb-hub-article-page .knowledge-article-attachments {
    margin-top: 32px; border: 1px solid var(--color-border); border-radius: 16px; padding: 18px 20px; background: var(--color-surface-solid);
  }
  .kb-hub-article-page .knowledge-article-attachments-title { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; color: var(--color-text); }
  .kb-hub-article-page .knowledge-article-attachments-title i { color: var(--color-text-muted); }
  .kb-hub-article-page .knowledge-article-attachment {
    display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 11px; background: var(--kb-chip-bg);
    transition: background .2s ease;
  }
  .kb-hub-article-page .knowledge-article-attachment:hover { background: var(--kb-chip-hover); }
  .kb-hub-article-page .knowledge-article-attachment-icon {
    flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
    background: var(--color-surface-solid); color: var(--kb-accent);
  }
  .kb-hub-article-page .knowledge-article-attachment-copy { flex: 1; }
  .kb-hub-article-page .knowledge-article-attachment-copy strong { display: block; font-size: 14px; color: var(--color-text); }
  .kb-hub-article-page .knowledge-article-attachment-copy small { font-size: 12px; color: var(--color-text-muted); }
  .kb-hub-article-page .knowledge-article-attachment-dl { color: var(--color-text-muted); }

  /* Feedback. */
  .kb-hub-article-page .knowledge-article-feedback {
    margin-top: 32px; border: 1px solid var(--color-border); border-radius: 16px; padding: 24px; background: var(--color-surface-solid); text-align: center;
  }
  .kb-hub-article-page .knowledge-article-feedback-title { display: block; font-size: 16px; margin-bottom: 14px; color: var(--color-text); }
  .kb-hub-article-page .knowledge-article-feedback-actions { display: flex; gap: 10px; justify-content: center; }
  .kb-hub-article-page .knowledge-article-feedback-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 11px;
    border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text);
    font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .2s ease;
  }
  .kb-hub-article-page .knowledge-article-feedback-btn:hover { border-color: color-mix(in srgb, var(--color-primary-500) 40%, transparent); }

  /* Relacionados. */
  .kb-hub-article-page .knowledge-article-related { margin-top: 40px; }
  .kb-hub-article-page .knowledge-article-related-title { display: block; font-size: 18px; letter-spacing: -.01em; margin-bottom: 16px; color: var(--color-text); }
  .kb-hub-article-page .knowledge-article-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .kb-hub-article-page .knowledge-article-related-card { display: flex; gap: 13px; align-items: flex-start; padding: 18px; }
  .kb-hub-article-page .knowledge-article-related-icon {
    flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--color-primary-500) 10%, transparent); color: var(--kb-accent);
  }
  .kb-hub-article-page .knowledge-article-related-copy strong { display: block; font-size: 14.5px; line-height: 1.35; color: var(--color-text); }
  .kb-hub-article-page .knowledge-article-related-copy small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--color-text-soft); }

  /* Navegação: card sticky à esquerda que rola por dentro se passar da viewport. */
  .kb-hub-article-page .knowledge-group-nav {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
  }
  .kb-hub-article-page .knowledge-group-nav-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .kb-hub-article-page .knowledge-group-nav-head strong { font-size: 14px; color: var(--color-text); }
  .kb-hub-article-page .knowledge-group-nav-head small { font-size: 12px; color: var(--color-text-muted); }
  .kb-hub-article-page .knowledge-article-toc-title { display: block; font-size: 14px; margin-bottom: 10px; color: var(--color-text); }

  @media (max-width: 900px) {
    .kb-hub-article-page .knowledge-group-category-grid,
    .kb-hub-article-page .knowledge-useful-grid { grid-template-columns: repeat(2, 1fr); }
    /* Empilha: conteúdo primeiro, navegação embaixo (não empurra o conteúdo). */
    .kb-hub-article-page .knowledge-group-layout { grid-template-columns: 1fr; }
    .kb-hub-article-page .knowledge-group-nav { position: static; max-height: none; overflow: visible; order: 2; }
    .kb-hub-article-page .knowledge-group-main { order: 1; }
    .kb-hub-article-page .knowledge-article-related-grid { grid-template-columns: 1fr; }
    .kb-hub-article-page .knowledge-group-welcome-hero { padding: 28px; }
    .kb-hub-article-page .knowledge-group-hero-brand { display: none; }
  }
  @media (max-width: 560px) {
    .kb-hub-article-page .knowledge-group-category-grid,
    .kb-hub-article-page .knowledge-useful-grid { grid-template-columns: 1fr; }
    .kb-hub-article-page .knowledge-article-head h2 { font-size: 27px; }
  }
} /* end @layer overrides (kb-hub-article-page) */

/* ============================================================
   ALVOS DE TOQUE DAS TELAS PÚBLICAS E DO PORTAL (fase 2)

   O bloco de toque em components.css cobre o shell administrativo
   (body.dashboard-shell-locked). Estas telas ficam fora dele: portal do
   solicitante, abertura pública de chamado e base de conhecimento — que
   são justamente as mais prováveis de serem abertas no celular.

   Aqui não é preciso marcar como important: os tamanhos originais são
   declarações normais deste mesmo arquivo (@layer overrides, a última),
   então basta este bloco vir depois na ordem do arquivo.

   Gate em (pointer: coarse), igual à fase 1: quem usa mouse mantém a
   densidade atual.
   ============================================================ */
@layer overrides {
  @media (pointer: coarse) {
    /* Paginação da lista de chamados: 32x32 era o menor alvo do portal e o
       de erro mais caro — errar o toque troca de página. */
    .requester-ticket-pagination-actions button {
      min-width: var(--nz-touch-target-min);
      height: var(--nz-touch-target-min);
    }

    /* Ações principais do portal: estavam em 42px, 2px abaixo do mínimo. */
    .requester-ticket-new-button,
    .requester-app-help-button,
    .requester-knowledge-link {
      min-height: var(--nz-touch-target-min);
    }

    /* Cabeçalho da base de conhecimento pública e link de acesso do
       formulário público de chamado. */
    .kb-hub-brand,
    .kb-hub-login,
    .knowledge-public-theme-toggle,
    .public-tool-login-link {
      min-width: var(--nz-touch-target-min);
      min-height: var(--nz-touch-target-min);
    }

    /* Barra de formatação própria do app (abertura de chamado pelo portal).
       São 4 botões: mesmo em 44px a barra cabe numa linha de 375px. */
    .public-richtext-toolbar button {
      min-width: var(--nz-touch-target-min);
      min-height: var(--nz-touch-target-min);
    }
  }
} /* end @layer overrides (alvos de toque fase 2) */

/* ============================================================
   QUADRO DE CHAMADOS EM TELA ESTREITA (fase 3)

   Existia uma regra em @media (max-width: 991.98px) que troca o board
   para empilhar (grid-auto-flow: row), mas ela estava INCOMPLETA: o
   `grid-auto-rows: 1fr` continuava valendo. Com as colunas viradas
   linhas, cada uma recebia 1/5 de uma altura fixa e os cards ficavam
   recortados em ~29px — dava para ver so o topo do numero do chamado.

   Aqui o board deixa de esticar (flex: 0 0 auto), as linhas passam a
   ter altura de conteudo e a rolagem fica por conta do
   .tickets-board-page, que ja e o container rolavel da tela.

   A barra de comandos tinha o mesmo tipo de problema: .command-bar__row,
   .command-bar__primary-actions e .filter-bar__left sao grids com
   trilhas fixas (220px 620px, 300px 124px 110px 62px, ...) que somavam
   mais de 800px dentro de um container de 315px. Como nao havia rolagem
   horizontal, busca, filtros e "Novo chamado" ficavam inalcancaveis.
   auto-fit com minmax segue o padrao ja dominante neste projeto.

   Tudo abaixo de 991.98px: o desktop nao e alcancado por estas regras.
   Sem marcacao important — sao declaracoes normais desta mesma layer,
   entao basta virem por ultimo.
   ============================================================ */
@layer overrides {
  /* O board empilha a partir de 991.98px, acompanhando a regra de
     grid-auto-flow que ja existia nesse mesmo breakpoint. Acima disso as
     cinco colunas ainda cabem lado a lado. */
  @media (max-width: 991.98px) {
    .helpdesk-workspace-board .helpdesk-board {
      grid-auto-rows: auto;
      flex: 0 0 auto;
      height: auto;
      overflow-y: visible;
    }
  }

  /* A barra de comandos precisa de um breakpoint MAIS LARGO que o do board:
     as trilhas fixas somam ~840px e ja estouram em 1024px (iPad deitado e
     janela estreita de desktop). Medido em 1024px antes da correcao:
     "Novo chamado" — a acao principal da tela — terminava em x=1095, fora
     da viewport, e como nao ha rolagem horizontal ficava inalcancavel;
     "Link publico" e os totais tambem. Por isso 1199.98px e nao 991.98px. */
  @media (max-width: 1199.98px) {
    .tickets-board-page .command-bar__row {
      grid-template-columns: minmax(0, 1fr);
    }

    .tickets-board-page .command-bar__primary-actions,
    .tickets-board-page .filter-bar__left,
    .tickets-board-page .command-bar__metrics {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    }

    /* min-width auto e o que impede um item de grid de encolher abaixo do
       conteudo; sem isto as trilhas acima voltam a estourar. */
    .tickets-board-page .command-bar__row > *,
    .tickets-board-page .command-bar__search,
    .tickets-board-page .filter-field {
      min-width: 0;
    }
  }
} /* end @layer overrides (quadro de chamados estreito) */

/* ============================================================
   ALVOS DE TOQUE DA BARRA DO INVENTARIO (fase 3)

   .inventory-toolbar-btn declara min-height 44px la em cima, mas
   `.inventory-page-shell .inventory-toolbar-btn` baixa para 36px — e e
   essa que vale, por especificidade (0,2,0 contra 0,1,0). Sao os botoes
   Importar / Exportar / Etiquetas / Incluir ativo, as acoes principais
   da tela, por isso o seletor abaixo repete o mesmo escopo.

   Sem marcacao important: com a especificidade igualada, basta vir por
   ultimo na mesma layer.
   ============================================================ */
@layer overrides {
  @media (pointer: coarse) {
    .inventory-page-shell .inventory-toolbar-btn {
      min-height: var(--nz-touch-target-min);
    }
  }
} /* end @layer overrides (barra do inventario) */

/* ============================================================
   ALVOS DE TOQUE DE CONHECIMENTO E MONITORAMENTO (fase 3)

   .knowledge-tab estava a 43px — 1px do minimo, mas e a navegacao
   principal da base de conhecimento. .monitoring-help-trigger (35x29) e
   .device-page-action__primary (36px de altura) ficam na Operacao ao vivo.

   Sem marcacao important: declaracoes normais desta mesma layer.
   ============================================================ */
@layer overrides {
  @media (pointer: coarse) {
    .knowledge-tab,
    .device-page-action__primary {
      min-height: var(--nz-touch-target-min);
    }

    .monitoring-help-trigger {
      min-width: var(--nz-touch-target-min);
      min-height: var(--nz-touch-target-min);
    }
  }
} /* end @layer overrides (toque conhecimento/monitoramento) */
