/* Semÿforos KPI */
.tag-semaforo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium, 500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag-semaforo.verde {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 25%, transparent);
}

.tag-semaforo.aura {
  background: color-mix(in srgb, var(--aura-neon) 18%, var(--surface));
  color: #0099CC;
  border-color: color-mix(in srgb, var(--aura-neon) 60%, transparent);
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--aura-neon) 40%, transparent),
    0 0 16px color-mix(in srgb, var(--aura-neon) 45%, transparent);
}

html.dark .tag-semaforo.aura {
  background: color-mix(in srgb, var(--aura-neon) 14%, #0a1520);
  color: var(--aura-neon-glow);
  border-color: color-mix(in srgb, var(--aura-neon) 50%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--aura-neon) 30%, transparent),
    0 0 18px color-mix(in srgb, var(--aura-neon) 35%, transparent);
}

.tag-semaforo.amarelo {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.tag-semaforo.vermelho {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 20%, transparent),
    0 0 14px color-mix(in srgb, var(--danger) 35%, transparent);
  animation: pulse-alerta 2.2s ease-in-out infinite;
}

@keyframes pulse-alerta {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 20%, transparent), 0 0 10px color-mix(in srgb, var(--danger) 25%, transparent); }
  50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent), 0 0 18px color-mix(in srgb, var(--danger) 45%, transparent); }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl, var(--radius));
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
}

.kpi-card.semaforo-verde::before { background: var(--ok); }
.kpi-card.semaforo-amarelo::before { background: var(--warn); }
.kpi-card.semaforo-vermelho::before {
  background: var(--danger);
  box-shadow: 0 0 12px color-mix(in srgb, var(--danger) 50%, transparent);
}

.kpi-card.kpi-aura::before {
  background: linear-gradient(90deg, var(--aura-neon), color-mix(in srgb, var(--aura-neon) 50%, var(--accent)));
  box-shadow: 0 0 10px color-mix(in srgb, var(--aura-neon) 50%, transparent);
}

.kpi-card .valor {
  font-size: 1.75rem;
  font-weight: var(--fw-semibold, 600);
  line-height: 1.1;
  margin: 0.35rem 0 0.15rem;
  color: var(--ink);
}
.kpi-card .titulo {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium, 500);
  color: var(--ink-soft, var(--muted));
  letter-spacing: 0.02em;
}

.kpi-card .meta-line {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.kpi-card .titulo {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Botões legados alinhados ao ui-kit (Lote 2) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h-md);
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft, var(--surface-2));
  color: var(--ink);
  font-weight: var(--fw-medium, 500);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.btn:hover {
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 40%, var(--line));
  background: var(--surface-muted, var(--surface-2));
}
.btn:focus-visible { outline: 2px solid var(--brand, var(--accent)); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ico {
  display: block;
  flex-shrink: 0;
  overflow: visible;
  color: var(--muted);
  transition: color 0.15s, transform 0.12s;
}

/* Outline = traço Heroicons (stroke-width fica no atributo SVG em user units do viewBox).
   Não definir stroke-width em CSS (px) — isso engrossa/deforma o ícone ao escalar. */
.ico-outline {
  fill: none !important;
  stroke: currentColor;
}

.ico-outline path,
.ico-outline circle,
.ico-outline line,
.ico-outline polyline,
.ico-outline polygon {
  fill: none;
}

.ico-solid,
.ico-mini,
.ico-micro {
  fill: currentColor;
  stroke: none;
}

.ico.active,
.tool-btn.active .ico,
.bottom-btn.active .ico,
.btn-icon:hover .ico { color: var(--accent); }

.btn-icon {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: var(--control-h-md);
  height: var(--control-h-md);
  min-width: var(--control-h-md);
  min-height: var(--control-h-md);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  overflow: visible;
  flex: 0 0 auto;
  line-height: 0;
  transition: background 0.15s, color 0.15s;
}
.btn-icon svg,
.btn-icon .icon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.btn-icon:hover {
  background: var(--surface-muted, var(--surface-2));
  color: var(--ink);
}
.btn-icon.is-active {
  color: var(--brand, var(--accent));
  background: var(--brand-soft, var(--accent-soft));
}

.btn-icon:focus-visible { outline: 2px solid var(--brand, var(--accent)); outline-offset: 1px; }
.btn-icon .ico { color: currentColor; }
.tool-btn .ico { color: currentColor; }

/* Legenda de uma palavra sob ações só-ícone (configuração e Android). */
html.crm-android .btn-icon[data-caption],
html.crm-android .ui-icon-btn[data-caption],
#view-config .btn-icon[data-caption],
#view-config .ui-icon-btn[data-caption] {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  width: auto;
  min-width: var(--control-h-md);
  height: auto;
  min-height: calc(var(--control-h-md) + 0.7rem);
  padding: 0.2rem 0.28rem 0.18rem;
  line-height: 1.05;
}
html.crm-android .btn-icon[data-caption]::after,
html.crm-android .ui-icon-btn[data-caption]::after,
#view-config .btn-icon[data-caption]::after,
#view-config .ui-icon-btn[data-caption]::after {
  content: attr(data-caption);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
  max-width: 4.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.crm-android .btn-icon[data-caption]:hover::after,
html.crm-android .ui-icon-btn[data-caption]:hover::after,
#view-config .btn-icon[data-caption]:hover::after,
#view-config .ui-icon-btn[data-caption]:hover::after {
  color: var(--ink-soft, var(--ink));
}

.bottom-btn {
  color: var(--muted);
}

.bottom-btn span[data-icon] {
  display: grid;
  place-items: center;
  height: 22px;
}

.btn-primary {
  background: var(--brand, var(--primary));
  border-color: var(--brand, var(--primary));
  color: var(--on-accent, #fff);
  font-weight: var(--fw-medium, 500);
}

.btn-primary:hover {
  background: var(--brand-hover, var(--primary-hover));
  border-color: var(--brand-hover, var(--primary-hover));
}

.btn-accent {
  background: var(--brand-soft, var(--accent-soft));
  border: 1px solid color-mix(in srgb, var(--brand, var(--accent)) 28%, var(--line));
  color: var(--brand, var(--accent));
  font-weight: var(--fw-medium, 500);
}

.btn-accent:hover {
  background: color-mix(in srgb, var(--brand, var(--accent)) 12%, var(--brand-soft, var(--accent-soft)));
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 45%, var(--line));
  color: var(--brand, var(--accent));
}

html.dark .btn-accent {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: color-mix(in srgb, var(--accent) 72%, #fff);
}

html.dark .btn-accent:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  color: color-mix(in srgb, var(--accent) 82%, #fff);
}

.btn-accent .ico {
  color: currentColor;
}

.btn-sm {
  min-height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--fs-xs);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--danger-soft));
}

/* Skeleton único (shimmer) — cadastros não redefine a base */
.skeleton,
.ui-skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    color-mix(in srgb, var(--line) 55%, var(--surface-2)) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.modal-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.15rem 0;
}

.modal-skeleton-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.skeleton-modal-label {
  width: 34%;
  height: 0.82rem;
}

.skeleton-modal-value {
  width: 42%;
  height: 0.82rem;
}

.skeleton-modal-hint {
  display: block;
  width: 72%;
  height: 0.9rem;
}

.open-chamado-pick-skeleton {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.skeleton-pick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-pick-line {
  flex: 1;
  height: 0.85rem;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

table.data th,
table.data td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

table.data th {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--fw-medium, 500);
  color: var(--ink-soft, var(--muted));
  background: var(--surface-soft, var(--surface));
}

table.data tr:last-child td { border-bottom: none; }

.row-alerta td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.input {
  width: 100%;
  min-height: var(--control-h-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder,
.input-ph::placeholder,
.composer-input::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 400;
  opacity: 1;
}

.input-date {
  position: relative;
  min-height: var(--control-h-md);
}

.input-date.is-empty {
  color: transparent;
}

.input-date.is-empty::-webkit-datetime-edit,
.input-date.is-empty::-webkit-datetime-edit-fields-wrapper {
  opacity: 0;
}

.input-date.is-empty::before {
  content: attr(data-hint-text);
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-size: var(--fs-md);
  font-family: var(--font);
  pointer-events: none;
}

.input-date:not(.is-empty)::before {
  display: none;
}

.input:focus {
  outline: none;
  border-color: var(--brand, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, var(--accent)) 16%, transparent);
}

/* Textareas multi-linha: 2 linhas fixas, sem resize (exceto auto-grow de domínio) */
textarea.input:not(.quick-reply-text):not(.composer-input):not(.crm-notes),
textarea.ui-textarea {
  min-height: var(--textarea-h);
  max-height: var(--textarea-h);
  height: var(--textarea-h);
  resize: none !important;
  overflow-y: auto;
  line-height: 1.4;
  padding: 0.35rem 0.55rem;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
  z-index: 999;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast.toast-ok {
  background: var(--success);
  color: #fff;
}

.action-pending-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  vertical-align: middle;
  opacity: 0.85;
}

.action-pending-dot.is-spin {
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: spin-pendente 0.75s linear infinite;
  background: transparent;
}

.action-pending-dot.is-error {
  background: var(--danger);
  animation: action-pending-fade 0.55s ease forwards;
}

@keyframes action-pending-fade {
  0% { opacity: 0; transform: scale(0.6); }
  40% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

.msg-wrap {
  position: relative;
}

.msg-wrap > .action-pending-dot {
  position: absolute;
  right: 0.15rem;
  bottom: -0.15rem;
  margin: 0;
  z-index: 2;
}

.crm-alert {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  margin-bottom: var(--space-3);
}

.crm-alert-info {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  color: var(--ink);
}

html.dark .crm-alert-info {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.crm-ads-origem .crm-ads-summary {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  margin: 0.35rem 0 0.5rem;
  line-height: 1.45;
}

.crm-ads-badge {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  vertical-align: middle;
  margin-left: 0.35rem;
  text-transform: uppercase;
}

.crm-ads-badge-deterministic {
  background: #dcfce7;
  color: #166534;
}

.crm-ads-badge-estimate {
  background: #fef3c7;
  color: #92400e;
}

html.dark .crm-ads-badge-deterministic {
  background: #14532d;
  color: #bbf7d0;
}

html.dark .crm-ads-badge-estimate {
  background: #78350f;
  color: #fde68a;
}

.crm-profile-add {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h-md);
  height: var(--control-h-md);
  border-radius: var(--radius-pill);
  border: 1px dashed var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  padding: 0;
}

.crm-profile-add .ico {
  width: 16px;
  height: 16px;
}

.crm-profile-add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Seletor de kits (cards) */
.kit-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.kit-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kit-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.kit-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.kit-card-preview {
  display: block;
  height: 64px;
  border-radius: 8px;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
}

.kit-preview-none {
  background-image: linear-gradient(135deg, var(--surface), var(--surface-2));
}

.kit-card-body strong {
  display: block;
  font-size: 0.82rem;
  color: var(--ink);
}

.kit-card-body small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

/* Guias — filtros compactos (datas 50/50 + chips) definidos em layout.css */
.guides-filters-compact .guides-search-main { width: 100%; }
.budget-discount-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.budget-discount-prefix {
  font-weight: 600;
  color: var(--muted);
}
.emit-target-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: var(--space-3) 0;
}
.emit-target-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}
.emit-target-option.is-disabled { opacity: 0.55; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


/* ——— Centro de notificações ——— */
.toast.toast-guide {
  background: var(--success);
  color: #fff;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: auto;
  cursor: default;
}

.notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell {
  position: relative;
  width: var(--control-h-md, 2.25rem);
  height: var(--control-h-md, 2.25rem);
  border-radius: 999px;
  flex-shrink: 0;
}

.notif-bell .ico {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  aspect-ratio: 1;
  flex: none;
}

.notif-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  box-sizing: border-box;
  min-width: 1.05rem;
  width: auto;
  height: 1.05rem;
  aspect-ratio: 1;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--danger, #c44);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--surface, #fff);
}

.notif-badge.hidden { display: none !important; }

.notif-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(380px, calc(100vw - 1.25rem));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 140;
  overflow: hidden;
}

.notif-panel.hidden { display: none !important; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft, #eee));
}

.notif-panel-head strong {
  font-size: var(--fs-sm, 0.82rem);
  font-weight: var(--fw-semibold, 600);
  letter-spacing: 0.01em;
}

.notif-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.notif-head-btn {
  width: 1.9rem;
  height: 1.9rem;
  color: var(--muted);
}

.notif-head-btn:hover {
  color: var(--ink);
  background: var(--surface-soft, var(--surface-2));
}

.notif-list {
  overflow-y: auto;
  padding: 0.35rem;
  flex: 1;
}

.notif-empty {
  margin: 1.2rem 0.75rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: center;
  line-height: 1.45;
}

.notif-item {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.55rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid transparent;
  margin-bottom: 0.3rem;
  background: color-mix(in srgb, var(--surface) 96%, var(--ink));
}

.notif-item.is-unread {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent-soft, #e8f2f4) 70%, var(--surface));
}

.notif-item[data-kind="error"] .notif-kind { color: var(--danger, #c44); }
.notif-item[data-kind="ok"] .notif-kind,
.notif-item[data-kind="guide"] .notif-kind { color: var(--success, #2a7); }
.notif-item[data-kind="pending"] .notif-kind { color: var(--accent); }

.notif-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notif-kind {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.notif-title {
  font-size: 0.84rem;
  line-height: 1.3;
  font-weight: 650;
}

.notif-body {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.notif-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.notif-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}

.notif-act {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.95rem;
  line-height: 1;
}

/* FAB mobile — topbar some no telefone */
@media (max-width: 860px) {
  .notif-panel {
    position: fixed;
    top: auto;
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
    right: 0.65rem;
    left: 0.65rem;
    width: auto;
    max-height: min(60vh, 460px);
  }
}

/* Cards sticky foram removidos; somente o modal central da fila é invasivo. */
.notif-sticky-host {
  display: none !important;
}

.notif-sticky-host.is-empty {
  display: none;
}

.notif-sticky-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius, 10px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  animation: notif-sticky-in 0.22s ease-out;
}

.notif-sticky-card.notif-sticky-error,
.notif-sticky-card.notif-sticky-queue {
  border-color: color-mix(in srgb, var(--danger, #c44) 45%, var(--line));
  background: color-mix(in srgb, var(--danger, #c44) 8%, var(--surface));
}

.notif-sticky-card.notif-sticky-guide {
  border-color: color-mix(in srgb, var(--success, #2a7) 40%, var(--line));
  background: color-mix(in srgb, var(--success, #2a7) 8%, var(--surface));
}

@keyframes notif-sticky-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-sticky-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.notif-sticky-head-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.notif-sticky-title {
  font-size: 0.86rem;
  line-height: 1.3;
  font-weight: 650;
}

.notif-sticky-body {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.notif-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.notif-sticky-link {
  color: var(--accent);
  font-weight: 650;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notif-sticky-hide {
  font-size: 0.7rem !important;
  padding: 0.15rem 0.4rem !important;
}

.notif-sticky-x {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 1.1rem;
  line-height: 1;
}

.notif-item.is-priority.is-unread {
  border-color: color-mix(in srgb, var(--danger, #c44) 30%, transparent);
}

.notif-item[data-kind="queue"] .notif-kind { color: var(--danger, #c44); }

@media (max-width: 860px) {
  .notif-sticky-host {
    top: auto;
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
    right: 0.65rem;
    left: 0.65rem;
    width: auto;
    max-height: min(45vh, 320px);
  }
}


/* HubMed Agent install wizard */
.hubmed-install-steps {
  margin: 0.5rem 0 0.75rem 1.1rem;
  padding: 0;
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.45;
}
.hubmed-install-steps li { margin: 0.35rem 0; }
.hubmed-install-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; }
.hubmed-install-status { min-height: 1.25rem; color: var(--muted); }
.emit-hubmed-panel .modal-hint a { color: var(--accent); font-weight: 650; }
.worker-monitor-modal { width: min(720px, calc(100vw - 1.5rem)); }
.worker-monitor-head { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); font-size: 0.86rem; }
.worker-monitor-live { width: 0.58rem; height: 0.58rem; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 0.28rem color-mix(in srgb, #22c55e 18%, transparent); }
.worker-monitor-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: min(58vh, 34rem); overflow: auto; }
.worker-monitor-event { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.72rem 0.25rem; border-top: 1px solid var(--line); }
.worker-monitor-dot { flex: 0 0 auto; width: 0.62rem; height: 0.62rem; margin-top: 0.28rem; border-radius: 999px; background: var(--accent); }
.worker-monitor-event.is-warning .worker-monitor-dot { background: #f59e0b; }
.worker-monitor-event.is-error .worker-monitor-dot { background: #ef4444; }
.worker-monitor-copy { min-width: 0; display: grid; gap: 0.2rem; }
.worker-monitor-copy strong { font-size: 0.9rem; }
.worker-monitor-copy small { color: var(--muted); overflow-wrap: anywhere; }
.worker-monitor-empty { padding: 1.5rem 0; color: var(--muted); text-align: center; }
.notif-panel-head {
  min-height: 2.45rem;
  padding: 0.4rem 0.65rem;
}

.notif-panel-head strong {
  font-size: var(--fs-sm, 0.82rem);
  font-weight: var(--fw-semibold, 600);
}

.notif-head-btn {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
}

.notif-clipboard-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
}

.notif-clipboard-check > .ico:last-child {
  position: absolute;
  right: -0.18rem;
  bottom: -0.1rem;
  padding: 1px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--success, var(--accent));
}

.notif-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-btn-notifications .notif-badge { pointer-events: none; }

/* Alerta invasivo compartilhado da fila (>20 min). Um único modal representa
   todos os clientes e sempre aponta para o mais antigo. */
.queue-alarm-root {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(7 27 43 / 42%);
  background: color-mix(in srgb, #071b2b 42%, transparent);
  backdrop-filter: blur(2px);
}
.queue-alarm-root.hidden { display: none !important; }
.queue-alarm-card {
  position: relative;
  width: min(24rem, calc(100% - 2rem));
  padding: 1.35rem 1.25rem 1.2rem;
  border: 1px solid rgb(210 150 150);
  border: 1px solid color-mix(in srgb, var(--danger, #c44) 40%, white);
  border-radius: 1.25rem;
  background: var(--surface, #fff);
  box-shadow: 0 24px 70px rgb(0 0 0 / 32%);
  text-align: center;
  animation: queue-alarm-in 0.24s ease-out, queue-alarm-pulse 2.4s ease-in-out 0.3s 2;
}
@keyframes queue-alarm-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes queue-alarm-pulse {
  0%, 100% { box-shadow: 0 24px 70px rgb(0 0 0 / 32%); }
  50% { box-shadow: 0 24px 70px rgb(0 0 0 / 32%), 0 0 0 8px color-mix(in srgb, var(--danger, #c44) 14%, transparent); }
}
.queue-alarm-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  color: var(--muted, #53606c);
}
.queue-alarm-close:hover { color: var(--text, #16212b); }
.queue-alarm-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.9rem;
  border-radius: 999px;
  background: var(--danger, #c44);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.queue-alarm-icon .ico { width: 2rem; height: 2rem; }
.queue-alarm-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--danger, #c44);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.queue-alarm-title {
  margin: 0;
  color: var(--text, #16212b);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
}
.queue-alarm-body {
  margin: 0.8rem auto 1.35rem;
  max-width: 28rem;
  color: var(--muted, #53606c);
  line-height: 1.5;
}
.queue-alarm-respond {
  min-width: 13rem;
  min-height: 2.9rem;
  font-size: 1rem;
  font-weight: 750;
}
@media (prefers-reduced-motion: reduce) {
  .queue-alarm-card { animation: none; }
}

/* Destaque do download Atendimento 33 (Config → HubMed) */
@keyframes hubmed-download-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

#cfg-hubmed-agent-download.is-download-pulse {
  animation: hubmed-download-pulse 1s ease-out 2;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.config-card.is-focus-ring {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}
