@import url("../../_cdn/vendor/fonts/tabler-icons.css");

/* ============================================
   HELPDESK DESIGN SYSTEM - SomVibe
   ============================================ */

:root {
  --hd-primary: var(--primary-color, var(--color-dois, #9f00ff));
  --hd-primary-light: var(--primary-color, var(--color-dois, #9f00ff));
  --hd-primary-dark: var(--color-quatro, #8400d6);
  --hd-primary-alpha: rgba(159, 0, 255, 0.12);

  --hd-success: var(--positive-color, #16a34a);
  --hd-success-alpha: rgba(22, 163, 74, 0.12);
  --hd-success-border: rgba(22, 163, 74, 0.28);
  --hd-warning: var(--pending-color, #d97706);
  --hd-warning-alpha: rgba(217, 119, 6, 0.12);
  --hd-warning-border: rgba(217, 119, 6, 0.2);
  --hd-danger: var(--negative-color, #dc2626);
  --hd-danger-dark: #b91c1c;
  --hd-danger-alpha: rgba(220, 38, 38, 0.12);
  --hd-info: #0e96e5;
  --hd-info-alpha: rgba(14, 150, 229, 0.12);

  --hd-gray-50: #fbf7ff;
  --hd-gray-100: #f4ecff;
  --hd-gray-200: #e7daf5;
  --hd-gray-300: #d2bedf;
  --hd-gray-400: #b59fc5;
  --hd-gray-500: #8f789d;
  --hd-gray-600: #725e7f;
  --hd-gray-700: #594867;
  --hd-gray-800: #2f1f42;
  --hd-gray-900: #1c1127;

  --hd-bg: var(--surface-color, var(--color-um, #ffffff));
  --hd-bg-subtle: var(--surface-high-color, var(--color-tres, #f1f1f1));
  --hd-bg-muted: var(--surface-highest-color, var(--color-cinco, #f6f6f6));
  --hd-border: var(--input-border-color, var(--surface-border-color, var(--color-cinco, #eeeeee)));
  --hd-border-strong: var(--surface-border-color, var(--color-seis, #dddddd));

  --hd-text: var(--on-surface-color, rgba(80, 80, 80, 1));
  --hd-text-muted: var(--on-surface-variant-color, rgba(80, 80, 80, 0.86));
  --hd-text-subtle: var(--on-surface-variant-color, rgba(80, 80, 80, 0.62));
  --hd-text-on-primary: var(--on-primary-color, #ffffff);
  --hd-text-on-primary-muted: rgba(255, 255, 255, 0.82);
  --hd-text-on-primary-soft: rgba(255, 255, 255, 0.88);
  --hd-text-on-primary-subtle: rgba(255, 255, 255, 0.58);
  --hd-text-on-primary-faint: rgba(255, 255, 255, 0.42);

  --hd-radius-sm: 4px;
  --hd-radius: 8px;
  --hd-radius-md: 12px;
  --hd-radius-lg: 16px;
  --hd-radius-xl: 24px;
  --hd-radius-full: 9999px;

  --hd-shadow-xs: 0 1px 2px rgba(18, 2, 39, 0.06);
  --hd-shadow-sm: 0 2px 8px rgba(18, 2, 39, 0.09);
  --hd-shadow: 0 4px 16px rgba(18, 2, 39, 0.12);
  --hd-shadow-lg: 0 8px 32px rgba(18, 2, 39, 0.16);
  --hd-shadow-xl: 0 20px 48px rgba(18, 2, 39, 0.2);
  --hd-widget-pulse-shadow: 0 4px 16px rgba(159, 0, 255, 0.4);
  --hd-widget-pulse-shadow-strong: 0 4px 24px rgba(159, 0, 255, 0.7), 0 0 0 6px rgba(159, 0, 255, 0.12);
  --hd-notify-shadow: 0 10px 34px rgba(18, 2, 39, 0.42), 0 2px 8px rgba(18, 2, 39, 0.3);
  --hd-mobile-panel-shadow: 0 -20px 45px rgba(18, 2, 39, 0.24);

  --hd-sp-1: 4px;
  --hd-sp-2: 8px;
  --hd-sp-3: 12px;
  --hd-sp-4: 16px;
  --hd-sp-5: 20px;
  --hd-sp-6: 24px;
  --hd-sp-8: 32px;
  --hd-sp-10: 40px;
  --hd-sp-12: 48px;

  --hd-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --hd-text-xs: 0.75rem;
  --hd-text-sm: 0.875rem;
  --hd-text-base: 1rem;
  --hd-text-lg: 1.125rem;
  --hd-text-xl: 1.25rem;
  --hd-text-2xl: 1.5rem;
  --hd-text-3xl: 1.875rem;

  --hd-t-fast: 120ms ease;
  --hd-t-base: 220ms ease;
  --hd-t-slow: 350ms ease;

  --hd-z-dropdown: 100;
  --hd-z-sticky: 200;
  --hd-z-modal: 900;
  --hd-z-widget: 1000;
  --hd-z-toast: 1100;
  --hd-overlay: rgba(0, 0, 0, 0.45);
  --hd-overlay-soft: rgba(0, 0, 0, 0.15);
  --hd-overlay-on-primary: rgba(255, 255, 255, 0.16);
  --hd-overlay-on-primary-border: rgba(255, 255, 255, 0.28);
  --hd-overlay-on-primary-strong: rgba(255, 255, 255, 0.26);
  --hd-overlay-on-primary-bright: rgba(255, 255, 255, 0.3);
  --hd-overlay-on-primary-ghost: rgba(255, 255, 255, 0.08);
  --hd-wave-bg: rgba(18, 2, 39, 0.14);
  --hd-wave-stripe: rgba(18, 2, 39, 0.18);
  --hd-surface-inverse: var(--hd-gray-900);
  --hd-surface-inverse-border: rgba(255, 255, 255, 0.08);
  --hd-read-receipt: var(--hd-info);
  --hd-read-receipt-on-primary: rgba(255, 255, 255, 0.92);
  --hd-online: #4ade80;
  --hd-highlight: var(--hd-primary-alpha);
  --hd-select-caret-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23b59fc5' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

body.dashboard_main {
  --hd-primary: var(--color-dois, #9f00ff);
  --hd-primary-light: var(--color-dois, #9f00ff);
  --hd-primary-dark: var(--color-quatro, #8400d6);
  --hd-primary-alpha: rgba(159, 0, 255, 0.12);

  --hd-bg: var(--color-um, #ffffff);
  --hd-bg-subtle: var(--color-tres, #f1f1f1);
  --hd-bg-muted: var(--background-color, #f6f6f6);
  --hd-border: var(--color-cinco, #eeeeee);
  --hd-border-strong: var(--color-seis, #dddddd);
}

body:not(.dashboard_main) {
  --hd-bg: #ffffff;
  --hd-bg-subtle: #f7f3fb;
  --hd-bg-muted: #f2ecf8;
  --hd-border: #e9ddf4;
  --hd-border-strong: #d8cde8;

  --hd-text: #120227;
  --hd-text-muted: rgba(80, 80, 80, 0.92);
  --hd-text-subtle: rgba(80, 80, 80, 0.68);

  --hd-shadow-xs: 0 1px 2px rgba(18, 2, 39, 0.05);
  --hd-shadow-sm: 0 3px 10px rgba(18, 2, 39, 0.08);
  --hd-shadow: 0 8px 20px rgba(18, 2, 39, 0.1);
  --hd-shadow-lg: 0 12px 28px rgba(18, 2, 39, 0.12);
  --hd-shadow-xl: 0 22px 46px rgba(18, 2, 39, 0.16);
}

.hd-root,
.hd-page,
.hd-widget-panel,
.hd-modal,
.hd-toast,
.hd-card,
.hd-input,
.hd-widget-input,
.hd-table {
  font-family: var(--hd-font);
}
.hd-hidden {
  display: none !important;
}

.hd-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--hd-sp-1);
  padding: 3px 10px;
  border-radius: var(--hd-radius-full);
  font-size: var(--hd-text-xs);
  font-weight: 600;
}
.hd-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.hd-badge--open {
  background: var(--hd-info-alpha);
  color: var(--hd-info);
}
.hd-badge--active {
  background: var(--hd-warning-alpha);
  color: var(--hd-warning);
}
.hd-badge--waiting {
  background: var(--hd-primary-alpha);
  color: var(--hd-primary);
}
.hd-badge--resolved {
  background: var(--hd-success-alpha);
  color: var(--hd-success);
}
.hd-badge--closed {
  background: var(--hd-gray-100);
  color: var(--hd-gray-500);
}
.hd-badge--urgent {
  background: var(--hd-danger-alpha);
  color: var(--hd-danger);
}

.hd-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--hd-sp-2);
  padding: 9px 18px;
  border: none;
  border-radius: var(--hd-radius);
  font-size: var(--hd-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--hd-t-base);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.hd-btn--primary {
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
}
.hd-btn--primary:hover {
  background: var(--hd-primary-dark);
  box-shadow: var(--hd-shadow-sm);
}
.hd-btn--secondary {
  background: var(--hd-bg-muted);
  color: var(--hd-text);
  border: 1px solid var(--hd-border);
}
.hd-btn--secondary:hover {
  background: var(--hd-gray-200);
}
.hd-btn--ghost {
  background: transparent;
  color: var(--hd-text-muted);
}
.hd-btn--ghost:hover {
  background: var(--hd-bg-muted);
  color: var(--hd-text);
}
.hd-btn--danger {
  background: var(--hd-danger-alpha);
  color: var(--hd-danger);
}
.hd-btn--sm {
  padding: 5px 12px;
  font-size: var(--hd-text-xs);
}
.hd-btn--lg {
  padding: 12px 24px;
  font-size: var(--hd-text-base);
}
.hd-btn--full {
  width: 100%;
  justify-content: center;
}
.hd-btn:active {
  transform: scale(0.97);
}
.hd-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hd-card {
  background: var(--hd-bg);
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius-md);
  box-shadow: var(--hd-shadow-sm);
  transition: box-shadow var(--hd-t-base);
}
.hd-card:hover {
  box-shadow: var(--hd-shadow);
}
.hd-card__header {
  padding: var(--hd-sp-5) var(--hd-sp-6);
  border-bottom: 1px solid var(--hd-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hd-card__title {
  font-size: var(--hd-text-base);
  font-weight: 700;
  color: var(--hd-text);
  margin: 0;
}
.hd-card__body {
  padding: var(--hd-sp-6);
}

.hd-kpi {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-2);
  padding: var(--hd-sp-5);
}
.hd-kpi__label {
  font-size: var(--hd-text-xs);
  font-weight: 600;
  color: var(--hd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hd-kpi__value {
  font-size: var(--hd-text-3xl);
  font-weight: 800;
  color: var(--hd-text);
  line-height: 1;
}
.hd-kpi__meta {
  font-size: var(--hd-text-xs);
  color: var(--hd-text-subtle);
}
.hd-kpi__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--hd-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.hd-field {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-1);
}
.hd-label {
  font-size: var(--hd-text-sm);
  font-weight: 600;
  color: var(--hd-text);
}
.hd-input {
  appearance: none;
  padding: 10px 14px;
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  background: var(--hd-bg);
  color: var(--hd-text);
  font: inherit;
  font-size: var(--hd-text-sm);
  transition: border-color var(--hd-t-fast), box-shadow var(--hd-t-fast);
  width: 100%;
}
.hd-input:focus {
  outline: none;
  border-color: var(--hd-primary);
  box-shadow: 0 0 0 3px var(--hd-primary-alpha);
}
.hd-input--error {
  border-color: var(--hd-danger);
}
.hd-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.hd-select {
  background-image: var(--hd-select-caret-icon);
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.hd-messages {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-4);
  padding: var(--hd-sp-6);
  overflow-y: auto;
  flex: 1;
}
.hd-msg {
  display: flex;
  gap: var(--hd-sp-3);
  animation: hdSlideUp var(--hd-t-base);
}
.hd-msg--agent {
  justify-content: flex-start;
}
.hd-msg--client {
  justify-content: flex-end;
}
.hd-msg--system {
  justify-content: center;
}
.hd-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.hd-msg__bubble {
  max-width: 72%;
  padding: 10px 16px;
  border-radius: var(--hd-radius-md);
  font-size: var(--hd-text-sm);
  line-height: 1.6;
  word-break: break-word;
}
.hd-msg--agent .hd-msg__bubble {
  background: var(--hd-bg-muted);
  color: var(--hd-text);
  border-bottom-left-radius: var(--hd-radius-sm);
}
.hd-msg--client .hd-msg__bubble {
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
  border-bottom-right-radius: var(--hd-radius-sm);
}
.hd-msg--system .hd-msg__bubble {
  background: transparent;
  color: var(--hd-text-subtle);
  font-size: var(--hd-text-xs);
  font-style: italic;
}
.hd-msg__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.hd-msg--has-receipt .hd-msg__meta {
  justify-content: flex-end;
}
.hd-msg__time {
  font-size: var(--hd-text-xs);
  color: var(--hd-text-subtle);
  margin-top: 0;
  display: inline-flex;
  align-items: center;
}
.hd-msg--client .hd-msg__time {
  text-align: right;
}
.hd-msg__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.hd-msg__status--sending,
.hd-msg__status--sent {
  color: var(--hd-text-subtle);
}
.hd-msg__status--received {
  color: var(--hd-text-muted);
}
.hd-msg__status--read {
  color: var(--hd-read-receipt);
}
.hd-msg--client .hd-msg__status--sending,
.hd-msg--client .hd-msg__status--sent,
.hd-msg--client .hd-msg__status--received {
  color: var(--hd-text-on-primary-muted);
}
.hd-msg--client .hd-msg__status--read {
  color: var(--hd-read-receipt-on-primary);
}
#hdWidgetMessages.hd-messages {
  gap: 0;
}
#hdWidgetMessages .hd-msg {
  margin-bottom: 10px;
}
#hdChatMessages.hd-messages,
#hdAdminMessages.hd-messages {
  gap: 0;
}
#hdChatMessages .hd-msg,
#hdAdminMessages .hd-msg {
  margin-bottom: 10px;
}
#hdWidgetMessages .hd-msg--group-start,
#hdWidgetMessages .hd-msg--group-mid {
  margin-bottom: 2px;
}
#hdChatMessages .hd-msg--group-start,
#hdChatMessages .hd-msg--group-mid,
#hdAdminMessages .hd-msg--group-start,
#hdAdminMessages .hd-msg--group-mid {
  margin-bottom: 2px;
}
#hdWidgetMessages .hd-msg--group-end,
#hdWidgetMessages .hd-msg--solo {
  margin-bottom: 10px;
}
#hdChatMessages .hd-msg--group-end,
#hdChatMessages .hd-msg--solo,
#hdAdminMessages .hd-msg--group-end,
#hdAdminMessages .hd-msg--solo {
  margin-bottom: 10px;
}
#hdWidgetMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble,
#hdWidgetMessages .hd-msg--agent.hd-msg--group-end .hd-msg__bubble {
  border-top-left-radius: var(--hd-radius-sm);
}
#hdChatMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble,
#hdChatMessages .hd-msg--agent.hd-msg--group-end .hd-msg__bubble,
#hdAdminMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble,
#hdAdminMessages .hd-msg--agent.hd-msg--group-end .hd-msg__bubble {
  border-top-left-radius: var(--hd-radius-sm);
}
#hdWidgetMessages .hd-msg--agent.hd-msg--group-start .hd-msg__bubble,
#hdWidgetMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble {
  border-bottom-left-radius: var(--hd-radius-sm);
}
#hdChatMessages .hd-msg--agent.hd-msg--group-start .hd-msg__bubble,
#hdChatMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble,
#hdAdminMessages .hd-msg--agent.hd-msg--group-start .hd-msg__bubble,
#hdAdminMessages .hd-msg--agent.hd-msg--group-mid .hd-msg__bubble {
  border-bottom-left-radius: var(--hd-radius-sm);
}
#hdWidgetMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble,
#hdWidgetMessages .hd-msg--client.hd-msg--group-end .hd-msg__bubble {
  border-top-right-radius: var(--hd-radius-sm);
}
#hdChatMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble,
#hdChatMessages .hd-msg--client.hd-msg--group-end .hd-msg__bubble,
#hdAdminMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble,
#hdAdminMessages .hd-msg--client.hd-msg--group-end .hd-msg__bubble {
  border-top-right-radius: var(--hd-radius-sm);
}
#hdWidgetMessages .hd-msg--client.hd-msg--group-start .hd-msg__bubble,
#hdWidgetMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble {
  border-bottom-right-radius: var(--hd-radius-sm);
}
#hdChatMessages .hd-msg--client.hd-msg--group-start .hd-msg__bubble,
#hdChatMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble,
#hdAdminMessages .hd-msg--client.hd-msg--group-start .hd-msg__bubble,
#hdAdminMessages .hd-msg--client.hd-msg--group-mid .hd-msg__bubble {
  border-bottom-right-radius: var(--hd-radius-sm);
}
.hd-msg-divider {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-3);
  margin: var(--hd-sp-4) 0 var(--hd-sp-2);
  color: var(--hd-text-muted);
  font-size: 11px;
  font-weight: 600;
}
.hd-msg-divider::before,
.hd-msg-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hd-border);
}
.hd-msg-attachments {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-msg-file {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--hd-text-xs);
  font-family: inherit;
  color: var(--hd-primary);
  text-align: left;
}
.hd-msg-file:hover {
  text-decoration: underline;
}
.hd-msg-file--image {
  cursor: zoom-in;
}
.hd-msg-audio {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-msg-audio audio {
  width: 100%;
  max-width: 260px;
  height: 34px;
}
.hd-msg-audio a {
  text-decoration: none;
  font-size: var(--hd-text-xs);
  color: var(--hd-primary);
}
.hd-msg-audio--custom {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--hd-radius-full);
  border: 1px solid var(--hd-border);
  background: var(--hd-bg);
  min-width: 220px;
  max-width: 280px;
}
.hd-msg-audio--custom audio {
  display: none;
}
.hd-msg-audio__toggle {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--hd-t-fast), background var(--hd-t-fast);
}
.hd-msg-audio__toggle:hover {
  transform: scale(1.06);
  background: var(--hd-primary-dark);
}
.hd-msg-audio__content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-msg-audio__track {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  width: 100%;
}
.hd-msg-audio__wave {
  position: relative;
  display: block;
  width: 100%;
  height: 6px;
  border-radius: var(--hd-radius-full);
  background: var(--hd-wave-bg);
  overflow: hidden;
}
.hd-msg-audio__wave::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    90deg,
    var(--hd-wave-stripe) 0 2px,
    transparent 2px 5px
  );
}
.hd-msg-audio__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--hd-primary), var(--hd-primary-light));
  border-radius: inherit;
}
.hd-msg-audio__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hd-text-muted);
  line-height: 1;
}
.hd-msg-audio__download {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hd-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--hd-text-muted);
  text-decoration: none;
  background: var(--hd-bg-subtle);
  transition: all var(--hd-t-fast);
}
.hd-msg-audio__download:hover {
  color: var(--hd-primary);
  border-color: var(--hd-primary);
}
.hd-msg-audio--custom.is-playing .hd-msg-audio__toggle {
  background: var(--hd-primary-dark);
}
.hd-msg--client .hd-msg-file,
.hd-msg--client .hd-msg-audio a {
  color: var(--hd-text-on-primary);
}
.hd-msg--client .hd-msg-audio--custom {
  background: var(--hd-overlay-on-primary);
  border-color: var(--hd-overlay-on-primary-border);
}
.hd-msg--client .hd-msg-audio__wave {
  background: var(--hd-overlay-on-primary-strong);
}
.hd-msg--client .hd-msg-audio__wave::before {
  background: repeating-linear-gradient(
    90deg,
    var(--hd-overlay-on-primary-strong) 0 2px,
    transparent 2px 5px
  );
}
.hd-msg--client .hd-msg-audio__fill {
  background: var(--hd-text-on-primary-soft);
}
.hd-msg--client .hd-msg-audio__meta {
  color: var(--hd-text-on-primary-soft);
}
.hd-msg--client .hd-msg-audio__download {
  background: var(--hd-overlay-on-primary);
  border-color: var(--hd-overlay-on-primary-border);
  color: var(--hd-text-on-primary);
}
.hd-msg--client .hd-msg-audio__download:hover {
  background: var(--hd-overlay-on-primary-strong);
}

.hd-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.hd-msg__bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  min-width: 52px;
}
.hd-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hd-gray-400);
  animation: hdTypingBounce 1.2s infinite;
}
.hd-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.hd-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
.hd-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hd-gray-400);
  animation: hdTyping 1.4s infinite;
}
.hd-typing__dot:nth-child(2) {
  animation-delay: 0.2s;
}
.hd-typing__dot:nth-child(3) {
  animation-delay: 0.4s;
}
.hd-scroll-btn {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%) translateY(8px);
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
  border: none;
  border-radius: var(--hd-radius-full);
  padding: 6px 16px;
  font-size: var(--hd-text-xs);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--hd-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 2;
}
.hd-scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hd-table {
  width: 100%;
  border-collapse: collapse;
}
.hd-table thead {
  background: var(--hd-bg-subtle);
}
.hd-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--hd-text-xs);
  font-weight: 700;
  color: var(--hd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--hd-border);
  white-space: nowrap;
}
.hd-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hd-border);
  font-size: var(--hd-text-sm);
  color: var(--hd-text-muted);
  vertical-align: middle;
}
.hd-table tbody tr {
  transition: background var(--hd-t-fast);
}
.hd-table tbody tr:hover {
  background: var(--hd-bg-subtle);
}
.hd-table tbody tr:last-child td {
  border-bottom: 0;
}

.hd-admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.hd-sidebar {
  background: var(--hd-bg);
  border-right: 1px solid var(--hd-border);
  padding: var(--hd-sp-6) 0;
}
.hd-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hd-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-3);
  padding: 10px var(--hd-sp-5);
  color: var(--hd-text-muted);
  font-size: var(--hd-text-sm);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--hd-t-fast);
  font-weight: 500;
}
.hd-sidebar__link:hover {
  background: var(--hd-primary-alpha);
  color: var(--hd-primary);
}
.hd-sidebar__link.active {
  background: var(--hd-primary-alpha);
  color: var(--hd-primary);
  border-left-color: var(--hd-primary);
}

.hd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--hd-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--hd-sp-4);
  z-index: var(--hd-z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hd-t-base), visibility var(--hd-t-base);
}
.hd-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.hd-modal {
  background: var(--hd-bg);
  border-radius: var(--hd-radius-lg);
  box-shadow: var(--hd-shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--hd-t-base);
}
.hd-modal-backdrop.open .hd-modal {
  transform: none;
}
.hd-modal__header {
  padding: var(--hd-sp-5) var(--hd-sp-6);
  border-bottom: 1px solid var(--hd-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hd-modal__title {
  font-size: var(--hd-text-lg);
  font-weight: 700;
  color: var(--hd-text);
}
.hd-modal__close {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--hd-radius);
  color: var(--hd-text-subtle);
  transition: all var(--hd-t-fast);
  display: flex;
}
.hd-modal__close:hover {
  background: var(--hd-bg-muted);
  color: var(--hd-text);
}
.hd-modal__body {
  padding: var(--hd-sp-6);
}
.hd-modal__footer {
  padding: var(--hd-sp-4) var(--hd-sp-6);
  border-top: 1px solid var(--hd-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--hd-sp-3);
}
.hd-image-modal__body {
  padding: var(--hd-sp-4) var(--hd-sp-6);
}
.hd-image-modal__img {
  width: 100%;
  max-height: min(70vh, 700px);
  object-fit: contain;
  border-radius: var(--hd-radius);
  background: var(--hd-bg-subtle);
  border: 1px solid var(--hd-border);
}

.hd-toast-container {
  position: fixed;
  top: var(--hd-sp-5);
  right: var(--hd-sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-3);
  z-index: var(--hd-z-toast);
}
.hd-toast {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-3);
  padding: var(--hd-sp-3) var(--hd-sp-5);
  background: var(--hd-surface-inverse);
  color: var(--hd-text-on-primary);
  border-radius: var(--hd-radius);
  box-shadow: var(--hd-shadow-lg);
  font-size: var(--hd-text-sm);
  animation: hdSlideRight var(--hd-t-base);
  min-width: 280px;
  max-width: 380px;
}
.hd-toast--success {
  border-left: 4px solid var(--hd-success);
}
.hd-toast--error {
  border-left: 4px solid var(--hd-danger);
}
.hd-toast--warning {
  border-left: 4px solid var(--hd-warning);
}

/* ---- Client Helpdesk ---- */
.hd-client-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: var(--hd-sp-8) var(--hd-sp-6);
}
.hd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--hd-sp-8);
  gap: var(--hd-sp-3);
}
.hd-page-title {
  font-size: var(--hd-text-2xl);
  font-weight: 800;
  color: var(--hd-text);
  margin: 0;
}
.hd-page-subtitle {
  margin: 4px 0 0;
  font-size: var(--hd-text-sm);
  color: var(--hd-text-muted);
}
.hd-alert {
  background: var(--hd-warning-alpha);
  color: var(--hd-warning);
  border: 1px solid var(--hd-warning-border);
  border-radius: var(--hd-radius);
  padding: var(--hd-sp-4);
  margin-bottom: var(--hd-sp-5);
}
.hd-ticket-list {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-3);
}
.hd-ticket-item {
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius-md);
  padding: var(--hd-sp-4);
  background: var(--hd-bg);
  text-decoration: none;
  color: inherit;
  transition: all var(--hd-t-fast);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--hd-sp-4);
}
.hd-ticket-item:hover {
  border-color: var(--hd-primary);
  box-shadow: var(--hd-shadow-sm);
}
.hd-ticket-item__title {
  margin: 0 0 5px;
  color: var(--hd-text);
  font-weight: 700;
  font-size: var(--hd-text-base);
}
.hd-ticket-item__meta {
  margin: 0;
  color: var(--hd-text-muted);
  font-size: var(--hd-text-xs);
}
.hd-pill-tabs {
  display: inline-flex;
  background: var(--hd-bg-muted);
  border-radius: var(--hd-radius-full);
  padding: 3px;
  margin-bottom: var(--hd-sp-5);
  gap: 3px;
}
.hd-pill-tab {
  border: 0;
  background: transparent;
  color: var(--hd-text-muted);
  font-size: var(--hd-text-xs);
  font-weight: 700;
  border-radius: var(--hd-radius-full);
  padding: 7px 14px;
  cursor: pointer;
}
.hd-pill-tab.active {
  background: var(--hd-bg);
  color: var(--hd-primary);
  box-shadow: var(--hd-shadow-xs);
}
.hd-ticket-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--hd-sp-5);
}
.hd-ticket-main,
.hd-ticket-side {
  min-width: 0;
}
.hd-ticket-reply {
  padding: var(--hd-sp-4);
  border-top: 1px solid var(--hd-border);
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-3);
}
.hd-list-empty {
  text-align: center;
  color: var(--hd-text-muted);
  padding: var(--hd-sp-8);
}
.hd-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: var(--hd-sp-5);
}

/* ---- Floating Widget ---- */
.hd-widget-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-light));
  border: none;
  color: var(--hd-text-on-primary);
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(23, 7, 53, 0.35), 0 6px 16px rgba(23, 7, 53, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all var(--hd-t-base);
  z-index: var(--hd-z-widget);
  overflow: visible;
}
.hd-widget-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 24px 44px rgba(23, 7, 53, 0.42), 0 8px 18px rgba(23, 7, 53, 0.26);
}
.hd-widget-btn.has-unread {
  animation: hdWidgetPulse 2s infinite;
}
.hd-widget-btn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06) 62%);
  pointer-events: none;
}
.hd-widget-btn__pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(141, 38, 255, 0.28) 0%, rgba(141, 38, 255, 0.14) 30%, rgba(141, 38, 255, 0) 72%);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.28s ease, transform 0.32s ease;
  pointer-events: none;
}
.hd-widget-btn:hover .hd-widget-btn__pulse {
  opacity: 1;
  transform: scale(1);
}
.hd-widget-btn__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.hd-widget-btn .hd-widget-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  background: var(--hd-danger);
  color: var(--hd-text-on-primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hd-bg);
  padding: 0 4px;
  box-shadow: 0 8px 18px rgba(186, 18, 56, 0.33);
}

/* ---- Notificação flutuante do chat ---- */
.hd-notify {
  position: fixed;
  right: 24px;
  bottom: calc(24px + 62px + 14px);
  width: min(420px, calc(100vw - 32px));
  background: var(--hd-bg);
  border: 1px solid var(--hd-border);
  border-radius: 18px;
  box-shadow: 0 24px 54px rgba(9, 13, 38, 0.23), 0 6px 14px rgba(9, 13, 38, 0.12);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  z-index: var(--hd-z-widget);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease, box-shadow 0.24s ease;
  pointer-events: none;
}
.hd-notify:not(.hd-hidden) {
  pointer-events: auto;
}
.hd-notify.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.hd-notify:hover {
  box-shadow: 0 28px 58px rgba(9, 13, 38, 0.28), 0 8px 18px rgba(9, 13, 38, 0.13);
}
.hd-notify__avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  overflow: hidden;
  border: 2px solid var(--hd-bg);
  box-shadow: 0 6px 16px rgba(102, 40, 210, 0.28);
}
.hd-notify__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.hd-notify__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-notify__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  order: 2;
}
.hd-notify__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--hd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.hd-notify__time {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--hd-text-subtle);
  white-space: nowrap;
}
.hd-notify__time::before {
  content: "•";
  margin-right: 6px;
  color: var(--hd-text-subtle);
}
.hd-notify__text {
  order: 1;
  font-size: 17px;
  color: var(--hd-text);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.hd-notify__close {
  background: none;
  border: none;
  color: var(--hd-text-subtle);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-top: 1px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity var(--hd-t-fast), color var(--hd-t-fast);
}
.hd-notify:hover .hd-notify__close {
  opacity: 1;
}
.hd-notify__close:hover {
  color: var(--hd-primary);
}
.hd-notify.dismissing {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-widget-panel {
  position: fixed;
  bottom: calc(24px + 68px);
  right: 24px;
  width: 390px;
  height: 580px;
  background: var(--hd-bg);
  border-radius: var(--hd-radius-xl);
  box-shadow: var(--hd-shadow-xl);
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
  pointer-events: none;
  z-index: var(--hd-z-widget);
  border: 1px solid var(--hd-border);
  overflow: hidden;
}
.hd-widget-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hd-widget-header {
  background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-light));
  padding: var(--hd-sp-4) var(--hd-sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.hd-widget-header-info {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-3);
}
.hd-widget-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hd-overlay-on-primary-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.hd-widget-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.hd-widget-header-title {
  color: var(--hd-text-on-primary);
  font-weight: 700;
  font-size: var(--hd-text-base);
  line-height: 1.2;
}
.hd-widget-header-status {
  color: var(--hd-text-on-primary-muted);
  font-size: var(--hd-text-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}
.hd-widget-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hd-online);
}
.hd-widget-close {
  background: none;
  border: none;
  color: var(--hd-text-on-primary-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--hd-radius);
  transition: all var(--hd-t-fast);
  display: flex;
  font-size: 18px;
}
.hd-widget-close:hover {
  background: var(--hd-overlay-soft);
  color: var(--hd-text-on-primary);
}

.hd-widget-tabs {
  display: flex;
  border-bottom: 1px solid var(--hd-border);
  flex-shrink: 0;
}
.hd-widget-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: var(--hd-text-sm);
  font-weight: 600;
  color: var(--hd-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--hd-t-fast);
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}
.hd-widget-tab.active {
  color: var(--hd-primary);
  border-bottom-color: var(--hd-primary);
}
.hd-widget-tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.hd-widget-tab-content.active {
  display: flex;
}

.hd-widget-input-area {
  padding: var(--hd-sp-3) var(--hd-sp-4);
  border-top: 1px solid var(--hd-border);
  display: flex;
  gap: var(--hd-sp-2);
  flex-shrink: 0;
}
.hd-widget-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius-full);
  background: var(--hd-bg-subtle);
  color: var(--hd-text);
  font: inherit;
  font-size: var(--hd-text-sm);
  transition: border-color var(--hd-t-fast);
}
.hd-widget-input:focus {
  outline: none;
  border-color: var(--hd-primary);
}
.hd-chat-input--textarea {
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border-radius: var(--hd-radius-md);
  line-height: 1.45;
}
.hd-widget-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--hd-t-fast);
}
.hd-widget-send:hover {
  background: var(--hd-primary-dark);
}
.hd-widget-send:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}
.hd-widget-send--secondary {
  background: var(--hd-bg-muted);
  color: var(--hd-text-muted);
  border: 1px solid var(--hd-border);
}
.hd-widget-send--secondary:hover {
  background: var(--hd-gray-200);
  color: var(--hd-text);
}
.hd-emoji-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.hd-emoji-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(300px, 72vw);
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--hd-radius-md);
  border: 1px solid var(--hd-border);
  background: var(--hd-bg);
  box-shadow: var(--hd-shadow-lg);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.hd-emoji-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  width: 100%;
  min-height: 30px;
  padding: 3px 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--hd-t-fast);
}
.hd-emoji-item:hover {
  background: var(--hd-bg-subtle);
  border-color: var(--hd-border);
}
.hd-emoji-item:focus {
  outline: none;
  border-color: var(--hd-primary);
  box-shadow: 0 0 0 2px var(--hd-primary-alpha);
}
.hd-widget-send--recording {
  background: var(--hd-danger);
  color: var(--hd-text-on-primary);
  border-color: transparent;
  animation: hdPulse 1.2s infinite;
}
.hd-widget-send--recording:hover {
  background: var(--hd-danger-dark);
  color: var(--hd-text-on-primary);
}
.hd-icon-spin {
  display: inline-block;
  animation: hdSpin 0.9s linear infinite;
}
.hd-files-hint {
  padding: 0 var(--hd-sp-4) var(--hd-sp-2);
  font-size: var(--hd-text-xs);
  color: var(--hd-text-muted);
  min-height: 20px;
}
.hd-audio-notice {
  margin: 6px var(--hd-sp-4) 0;
  border: 1px solid var(--hd-border);
  background: var(--hd-bg-subtle);
  color: var(--hd-text-muted);
  border-radius: var(--hd-radius);
  padding: 6px 10px;
  font-size: var(--hd-text-xs);
}
.hd-audio-notice.is-enabled {
  border-color: var(--hd-success-border);
  background: var(--hd-success-alpha);
  color: var(--hd-success);
}
.hd-widget-welcome {
  flex: 1;
  overflow-y: auto;
  padding: var(--hd-sp-6);
  padding-bottom: var(--hd-sp-8);
  text-align: center;
  color: var(--hd-text-muted);
}
.hd-widget-kb-results {
  max-height: 190px;
  overflow-y: auto;
}
.hd-widget-kb-article {
  margin-top: 8px;
}
.hd-widget-ticket-list {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-2);
  padding: var(--hd-sp-4);
  overflow-y: auto;
}
.hd-widget-csat {
  padding: var(--hd-sp-5);
  text-align: center;
  border-top: 1px solid var(--hd-border);
  border-bottom: 1px solid var(--hd-border);
  background: var(--hd-bg-subtle);
}
.hd-widget-csat__prompt {
  font-size: var(--hd-text-sm);
  font-weight: 700;
  color: var(--hd-text);
  margin: 0 0 var(--hd-sp-3);
}
.hd-star-rating {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.hd-star-rating button {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--hd-gray-300);
  cursor: pointer;
  transition: color var(--hd-t-fast), transform var(--hd-t-fast);
  line-height: 1;
}
.hd-star-rating button:hover,
.hd-star-rating button.active {
  color: var(--hd-warning);
  transform: scale(1.12);
}
.hd-widget-csat__thanks {
  font-size: var(--hd-text-sm);
  color: var(--hd-success);
  font-weight: 600;
  margin: 0;
}

/* ---- CSAT Modal ---- */
.hd-csat-modal .hd-csat-emojis {
  display: flex;
  justify-content: center;
  gap: var(--hd-sp-3);
  margin: var(--hd-sp-5) 0;
}
.hd-csat-emoji {
  width: 52px;
  height: 52px;
  border-radius: var(--hd-radius-md);
  border: 2px solid transparent;
  background: var(--hd-bg-muted);
  cursor: pointer;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--hd-t-base);
}
.hd-csat-emoji:hover {
  transform: scale(1.15);
  border-color: var(--hd-border-strong);
}
.hd-csat-emoji.selected {
  border-color: var(--hd-primary);
  background: var(--hd-primary-alpha);
  transform: scale(1.12);
}
.hd-csat-label {
  text-align: center;
  font-size: var(--hd-text-xs);
  color: var(--hd-text-muted);
  margin-top: var(--hd-sp-2);
  height: 18px;
}
.hd-csat-success {
  text-align: center;
  padding: var(--hd-sp-8) var(--hd-sp-6);
  animation: hdFadeIn var(--hd-t-base);
}
.hd-csat-success-icon {
  font-size: 48px;
  margin-bottom: var(--hd-sp-3);
}
.hd-csat-success-text {
  font-size: var(--hd-text-lg);
  font-weight: 700;
  color: var(--hd-text);
}

/* ---- Admin pages ---- */
.hd-admin-page {
  display: flex;
  flex-direction: column;
  gap: var(--hd-sp-5);
}
.hd-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--hd-sp-4);
  flex-wrap: wrap;
}
.hd-dashboard-grid {
  display: grid;
  gap: var(--hd-sp-5);
}
.hd-kpi-grid {
  grid-template-columns: repeat(4, 1fr);
}
.hd-chart-grid {
  grid-template-columns: 1fr 1fr;
}
.hd-chart-card {
  padding: var(--hd-sp-5);
  min-height: 320px;
}
.hd-chart-wrap {
  position: relative;
  height: 260px;
}
.hd-filter-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--hd-sp-2);
}
.hd-filter-inline {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-2);
}
#hdChatHeader {
  display: block;
  width: 100%;
}
.hd-chat-header-meta {
  display: block;
  margin-top: 4px;
  color: var(--hd-text-muted);
}
.hd-chat-head {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hd-chat-head__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.hd-chat-head__identity {
  min-width: 0;
}
.hd-chat-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--hd-sp-2);
  min-width: 0;
}
#hdChatTagsBadges {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hd-chat-head__controls {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.hd-chat-timers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
}
.hd-chat-timer {
  padding: 8px 10px;
  border: 1px solid var(--hd-border);
  border-radius: 8px;
  background: var(--hd-bg-subtle);
}
.hd-chat-timer small {
  display: block;
  color: var(--hd-text-subtle);
  font-size: 11px;
  line-height: 1.3;
}
.hd-chat-timer__value {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
  color: var(--hd-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hd-chat-header-controls {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(280px, 1fr);
  align-items: center;
}
.hd-chat-header-controls > .hd-select {
  width: 100%;
  min-width: 0;
}
.hd-input-action {
  position: relative;
  width: 100%;
  min-width: 0;
}
.hd-input-action__input {
  padding-right: 44px;
}
.hd-input-action__btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--hd-radius);
  background: var(--hd-primary);
  color: var(--hd-text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--hd-t-fast), opacity var(--hd-t-fast);
}
.hd-input-action__btn:hover {
  background: var(--hd-primary-dark);
}
.hd-input-action__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.hd-input--saving {
  opacity: 0.7;
}
.hd-ticket-view {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--hd-sp-5);
  height: calc(100vh - 120px);
}
.hd-ticket-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hd-ticket-sidebar {
  overflow-y: auto;
}
.hd-chat-monitor {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 120px);
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius-md);
  overflow: hidden;
}
.hd-chat-list {
  border-right: 1px solid var(--hd-border);
  overflow-y: auto;
}
.hd-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hd-chat-main .hd-widget-input-area {
  align-items: flex-end;
}
.hd-chat-main .hd-messages {
  min-height: 0;
}
.hd-admin-page--chat {
  height: calc(100vh - 120px);
  overflow: hidden;
}
.hd-chat-lock-scroll,
.hd-chat-lock-scroll body {
  overflow: hidden !important;
  height: 100%;
}
.hd-admin-page--chat > .hd-filter-inline {
  flex-shrink: 0;
}
.hd-admin-page--chat .hd-chat-monitor {
  height: 100%;
  min-height: 0;
}
.hd-chat-monitor--3col {
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  background: var(--hd-bg);
}
.hd-chat-monitor--3col .hd-chat-list,
.hd-chat-monitor--3col .hd-chat-main,
.hd-chat-monitor--3col .hd-chat-sidebar {
  background: var(--hd-bg);
}
.hd-chat-monitor--3col .hd-chat-main {
  border-left: 1px solid var(--hd-border);
  border-right: 1px solid var(--hd-border);
}
.hd-chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-height: 0;
  overflow-y: auto;
}
.hd-chat-sidebar__section {
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  background: var(--hd-bg);
  padding: 12px;
}
.hd-chat-sidebar__title {
  margin: 0;
  font-size: var(--hd-text-sm);
  font-weight: 700;
  color: var(--hd-text);
}
.hd-chat-sidebar__list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.hd-chat-user {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.hd-chat-user__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--hd-bg-muted);
  color: var(--hd-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hd-chat-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hd-chat-user__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hd-chat-user__meta strong {
  color: var(--hd-text);
  font-size: var(--hd-text-sm);
}
.hd-chat-user__meta span,
.hd-chat-user__meta small {
  color: var(--hd-text-muted);
  font-size: var(--hd-text-xs);
  line-height: 1.35;
}
.hd-chat-note-item {
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  padding: 10px;
  background: var(--hd-bg-subtle);
}
.hd-chat-note-item p {
  margin: 0 0 6px;
  color: var(--hd-text);
  font-size: var(--hd-text-sm);
  white-space: pre-wrap;
}
.hd-chat-note-item small {
  color: var(--hd-text-subtle);
  font-size: 11px;
}
.hd-chat-history-item {
  display: block;
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  padding: 10px;
  background: var(--hd-bg);
  text-decoration: none;
  transition: background var(--hd-t-fast), border-color var(--hd-t-fast);
}
.hd-chat-history-item:hover {
  background: var(--hd-bg-subtle);
  border-color: var(--hd-border-strong);
}
.hd-chat-history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.hd-chat-history-item__top strong {
  color: var(--hd-text);
  font-size: var(--hd-text-sm);
}
.hd-chat-history-item p {
  margin: 0 0 4px;
  color: var(--hd-text);
  font-size: var(--hd-text-sm);
  line-height: 1.35;
}
.hd-chat-history-item small {
  color: var(--hd-text-subtle);
  font-size: 11px;
}
.hd-conversation-history-modal__messages {
  max-height: min(68vh, 620px);
  min-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  background: var(--hd-bg-subtle);
  padding: var(--hd-sp-4);
}
.hd-audio-rec-state {
  padding: 6px 12px 0;
  color: var(--hd-text-muted);
  font-size: var(--hd-text-xs);
  line-height: 1.3;
}
.hd-audio-rec-state.is-recording {
  color: var(--hd-danger);
  font-weight: 700;
}
.hd-audio-rec-state.is-ready {
  color: var(--hd-primary);
}
.hd-audio-rec-state.is-sending {
  color: var(--hd-warning);
}
.hd-chat-session-item {
  border-bottom: 1px solid var(--hd-border);
  padding: var(--hd-sp-3);
  cursor: pointer;
  transition: background var(--hd-t-fast);
}
.hd-chat-session-item.is-favorite {
  box-shadow: inset 3px 0 0 var(--hd-primary);
}
.hd-chat-session-item:hover,
.hd-chat-session-item.active {
  background: var(--hd-bg-subtle);
}
.hd-chat-session-item.waiting .hd-badge-dot {
  animation: hdPulse 1.2s infinite;
}
.hd-chat-session-item__top-right {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}
.hd-chat-favorite-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hd-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--hd-t-fast);
  padding: 2px;
  line-height: 1;
  font-size: 18px;
}
.hd-chat-favorite-btn:hover {
  color: var(--hd-primary);
}
.hd-chat-favorite-btn.is-favorite {
  color: var(--hd-primary);
}
.hd-chat-favorite-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}
.hd-chat-favorite-btn--header {
  font-size: 20px;
  margin-right: 2px;
}
.hd-urgent-row {
  border-left: 3px solid var(--hd-danger);
}
.hd-overdue {
  color: var(--hd-danger);
  font-weight: 700;
}
.hd-progress {
  height: 10px;
  border-radius: var(--hd-radius-full);
  background: var(--hd-bg-muted);
  overflow: hidden;
}
.hd-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hd-primary), var(--hd-primary-light));
}
.hd-emoji-row {
  display: grid;
  grid-template-columns: 90px 1fr 52px;
  align-items: center;
  gap: var(--hd-sp-2);
  font-size: var(--hd-text-sm);
}
.hd-sortable-item {
  padding: var(--hd-sp-3);
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  background: var(--hd-bg);
  cursor: move;
}
.hd-sortable-item.dragging {
  opacity: 0.55;
}
.hd-admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--hd-danger);
  color: var(--hd-text-on-primary);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.hd-qr-dropdown {
  background: var(--hd-bg);
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  box-shadow: var(--hd-shadow-lg);
  z-index: 9999;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.hd-qr-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 1px solid var(--hd-border);
  transition: background var(--hd-t-fast);
}
.hd-qr-item:last-child {
  border-bottom: none;
}
.hd-qr-item:hover {
  background: var(--hd-bg-subtle);
}
.hd-qr-item.is-active {
  background: var(--hd-primary-alpha);
}
.hd-qr-item strong {
  font-size: 13px;
  color: var(--hd-text);
  font-weight: 600;
}
.hd-qr-item span {
  font-size: 12px;
  color: var(--hd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-kb-mark {
  background: var(--hd-highlight);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}
.hd-heatmap {
  display: grid;
  grid-template-columns: 32px repeat(24, minmax(18px, 1fr));
  gap: 2px;
  font-size: 10px;
  min-width: 620px;
}
.hd-heatmap__label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hd-text-muted);
  font-weight: 600;
}
.hd-heatmap__cell {
  aspect-ratio: 1;
  min-height: 14px;
  border-radius: 3px;
  background: var(--hd-gray-100);
  position: relative;
  transition: transform var(--hd-t-fast), filter var(--hd-t-fast);
}
.hd-heatmap__cell:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}
.hd-timeline {
  position: relative;
  padding-left: 20px;
}
.hd-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hd-border);
}
.hd-timeline-event {
  position: relative;
  margin-bottom: var(--hd-sp-4);
}
.hd-timeline-event::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hd-primary);
  border: 2px solid var(--hd-bg);
}
.hd-timeline-event__text {
  color: var(--hd-text);
  line-height: 1.4;
  font-size: var(--hd-text-sm);
}
.hd-timeline-event__time {
  color: var(--hd-text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.hd-collision-banner {
  display: flex;
  align-items: center;
  gap: var(--hd-sp-2);
  padding: 8px 14px;
  background: var(--hd-warning-alpha);
  border: 1px solid var(--hd-warning);
  border-radius: var(--hd-radius);
  font-size: var(--hd-text-sm);
  color: var(--hd-warning);
  font-weight: 600;
}

@keyframes hdSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes hdFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes hdSlideRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes hdPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@keyframes hdWidgetPulse {
  0%,
  100% {
    box-shadow: var(--hd-widget-pulse-shadow);
  }
  50% {
    box-shadow: var(--hd-widget-pulse-shadow-strong);
  }
}
@keyframes hdSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes hdTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}
@keyframes hdTypingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .hd-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hd-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hd-ticket-detail-layout {
    grid-template-columns: 1fr;
  }
  .hd-chat-monitor--3col {
    grid-template-columns: 260px minmax(0, 1fr) 300px;
  }
  .hd-chat-head__top {
    grid-template-columns: 1fr;
  }
  .hd-chat-head__actions {
    justify-content: flex-start;
  }
  .hd-chat-head__controls {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .hd-chat-timers {
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 768px) {
  .hd-client-layout {
    padding: var(--hd-sp-5);
  }
  .hd-chat-lock-scroll,
  .hd-chat-lock-scroll body {
    overflow: auto !important;
    height: auto;
  }
  .hd-admin-page--chat {
    height: auto;
    overflow: visible;
  }
  .hd-ticket-view {
    grid-template-columns: 1fr;
    height: auto;
  }
  .hd-chat-monitor {
    grid-template-columns: 1fr;
    height: auto;
  }
  .hd-chat-list {
    border-right: 0;
    border-bottom: 1px solid var(--hd-border);
    max-height: 280px;
  }
  .hd-chat-monitor--3col {
    grid-template-columns: 1fr;
  }
  .hd-chat-sidebar {
    border-top: 1px solid var(--hd-border);
    max-height: 320px;
  }
}

@media (max-width: 600px) {
  .hd-kpi-grid,
  .hd-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .hd-widget-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(88dvh, 760px);
    max-height: min(88dvh, 760px);
    border-top-left-radius: 1.1rem;
    border-top-right-radius: 1.1rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: var(--hd-mobile-panel-shadow);
    transform-origin: bottom center;
    transform: translateY(105%);
  }
  .hd-widget-panel.open {
    transform: translateY(0);
  }
  .hd-widget-header {
    position: sticky;
    top: 0;
    z-index: 2;
    border-top-left-radius: 1.1rem;
    border-top-right-radius: 1.1rem;
    padding-top: calc(var(--hd-sp-4) + env(safe-area-inset-top, 0px));
  }
  .hd-widget-input-area {
    padding-bottom: calc(var(--hd-sp-3) + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .hd-widget-panel {
    width: 100vw;
  }
  .hd-notify {
    right: 12px;
    bottom: calc(16px + 62px + 10px);
    width: calc(100vw - 24px);
    max-width: 360px;
  }
  .hd-widget-btn {
    bottom: 16px;
    right: 16px;
  }
}
