/* ============================================================
   PRIMECHAT — COMPONENTS.CSS
   Botões, badges, inputs, avatares, cards, modais, toasts...
   ============================================================ */

/* ===================================================
   BOTÕES
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  user-select: none;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Shimmer genérico */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  transform: skewX(-15deg);
  transition: none;
}

.btn:hover::before {
  animation: btnShimmer 0.6s ease forwards;
}

/* === PRIMARY === */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* === SECONDARY === */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: var(--bg-overlay);
  border-color: rgba(255,255,255,0.2);
}

.btn-secondary:active {
  background: var(--bg-elevated);
}

/* === GHOST === */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

/* === DANGER === */
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* === ACCENT GHOST === */
.btn-accent-ghost {
  background: var(--accent-glow-sm);
  color: var(--accent);
  border-color: rgba(79, 142, 247, 0.2);
}

.btn-accent-ghost:hover {
  background: var(--accent-glow);
  border-color: rgba(79, 142, 247, 0.4);
}

/* === SIZES === */
.btn-xs {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-xl {
  padding: 18px 36px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

/* === ICON ONLY === */
.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  padding: 5px;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  padding: 10px;
}

/* === LOADING STATE === */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading .btn-text { opacity: 0; }

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* === BTN GROUP === */
.btn-group {
  display: inline-flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.btn-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
}

.btn-group .btn:last-child { border-right: none; }


/* ===================================================
   BADGES / TAGS / CHIPS
   =================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Variantes */
.badge-bot {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-aberta {
  background: var(--accent-glow-sm);
  color: var(--accent);
  border: 1px solid rgba(79, 142, 247, 0.3);
}

.badge-pendente {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-resolvida {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-urgente {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-neutro {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-trial {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-pro {
  background: linear-gradient(135deg, rgba(79,142,247,0.15), rgba(168,85,247,0.15));
  color: var(--accent);
  border: 1px solid rgba(79,142,247,0.3);
}

/* Badge contador (inbox, notificações) */
.badge-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  animation: pulse-ring 2.5s infinite;
}

.badge-count.danger { background: var(--danger); }
.badge-count.warning { background: var(--warning); color: #000; }

/* Tag (rótulos coloridos no inbox) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
}

.tag-blue   { background: rgba(79,142,247,0.15); color: var(--accent); }
.tag-green  { background: rgba(34,197,94,0.15);  color: var(--success); }
.tag-red    { background: rgba(239,68,68,0.15);   color: var(--danger); }
.tag-yellow { background: rgba(245,158,11,0.15);  color: var(--warning); }
.tag-cyan   { background: rgba(6,182,212,0.15);   color: var(--info); }
.tag-purple { background: rgba(168,85,247,0.15);  color: #a855f7; }


/* ===================================================
   INPUTS / FORMS
   =================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:hover {
  border-color: rgba(255,255,255,0.14);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
  background: var(--bg-overlay);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-control.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

/* Select */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Input com ícone */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .form-control {
  padding-left: 40px;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
}

.input-icon-wrap:focus-within .input-icon {
  color: var(--accent);
}

/* Input com ícone à direita (toggle senha) */
.input-icon-wrap .input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.input-icon-wrap .input-icon-right:hover {
  color: var(--text-secondary);
}

/* Float label */
.float-label-wrap {
  position: relative;
}

.float-label-wrap .form-control {
  padding-top: 20px;
  padding-bottom: 6px;
  height: 56px;
}

.float-label-wrap .float-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.18s ease;
  transform-origin: left center;
}

.float-label-wrap .form-control:focus ~ .float-label,
.float-label-wrap .form-control:not(:placeholder-shown) ~ .float-label {
  top: 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translateY(0);
}

/* Form feedback */
.form-feedback {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-feedback.error   { color: var(--danger); }
.form-feedback.success { color: var(--success); }
.form-feedback.hint    { color: var(--text-muted); }

/* Checkbox e Radio */
.checkbox-wrap,
.radio-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"],
.radio-wrap input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label,
.radio-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
  pointer-events: none;
}

.toggle input:checked ~ .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(79,142,247,0.35);
}

.toggle input:checked ~ .toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}

.toggle input:focus-visible ~ .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Slider */
.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-glow-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79,142,247,0.2);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(79,142,247,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px rgba(79,142,247,0.7);
}

/* Search Input */
.search-input-wrap {
  position: relative;
}

.search-input-wrap .form-control {
  padding-left: 38px;
  padding-right: 36px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}

.search-input-wrap .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 2px;
}

.search-input-wrap .form-control:not(:placeholder-shown) ~ .search-clear {
  display: flex;
}


/* ===================================================
   AVATARES
   =================================================== */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-xs { width: 24px; height: 24px; font-size: 9px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; }

/* Wrapper de avatar com status */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar-status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.avatar-status.online  { background: var(--success); animation: online-pulse 2.5s infinite; }
.avatar-status.offline { background: var(--text-muted); }
.avatar-status.away    { background: var(--warning); }
.avatar-status.busy    { background: var(--danger); }

/* Cores geradas por hash do nome */
.avatar-color-0 { background: linear-gradient(135deg, #4f8ef7, #3a7ae8); color: #fff; }
.avatar-color-1 { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.avatar-color-2 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.avatar-color-3 { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.avatar-color-4 { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.avatar-color-5 { background: linear-gradient(135deg, #a855f7, #9333ea); color: #fff; }
.avatar-color-6 { background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; }
.avatar-color-7 { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }


/* ===================================================
   CARDS
   =================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { }

.card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* KPI Card */
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-base);
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.kpi-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-change {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }
.kpi-change.neutral  { color: var(--text-muted); }


/* ===================================================
   MODAIS
   =================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease-out;
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}


/* ===================================================
   TOASTS / NOTIFICAÇÕES
   =================================================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
}

.toast.closing {
  animation: toastOut 0.25s ease forwards;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast-success::before { background: var(--success); }
.toast-error::before   { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before    { background: var(--accent); }

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error   .toast-icon { background: var(--danger-bg);  color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info    .toast-icon { background: var(--accent-glow-sm); color: var(--accent); }

.toast-content { flex: 1; }

.toast-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text-primary); }

/* Progress bar de auto-close */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  border-radius: 0 1px 1px 0;
  transition: width linear;
}


/* ===================================================
   DROPDOWN
   =================================================== */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: 6px;
  animation: dropdownIn 0.18s ease-out;
}

.dropdown-menu.left { right: auto; left: 0; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.dropdown-item .item-icon {
  display: flex;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dropdown-item:hover .item-icon { color: inherit; }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-label {
  padding: 6px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ===================================================
   TABS
   =================================================== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition-fast);
  position: relative;
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab-item:hover {
  color: var(--text-secondary);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-item .tab-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}

.tab-item.active .tab-badge {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Tabs Pill style */
.tabs-pill {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: none;
}

.tabs-pill .tab-item {
  border: none;
  border-radius: var(--radius-sm);
  margin: 0;
}

.tabs-pill .tab-item.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
}


/* ===================================================
   TABLES
   =================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
}

.table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

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

.table .col-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}


/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-description {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.6;
}


/* ===================================================
   SKELETON LOADERS
   =================================================== */
.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
}

.skeleton-text.sm { height: 11px; width: 60%; }
.skeleton-text.md { height: 14px; width: 80%; }
.skeleton-text.lg { height: 18px; width: 40%; }

.skeleton-avatar-sm { width: 32px; height: 32px; border-radius: 50%; }
.skeleton-avatar-md { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-avatar-lg { width: 56px; height: 56px; border-radius: 50%; }

.skeleton-btn {
  height: 36px;
  width: 100px;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}


/* ===================================================
   COMMAND PALETTE (Ctrl+K)
   =================================================== */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: var(--z-command-palette);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  padding-left: 24px;
  padding-right: 24px;
  animation: fadeIn 0.15s ease;
}

/* Garante que hidden sempre esconde — sobrepõe o display:flex acima */
.command-palette-backdrop[hidden] {
  display: none !important;
}

.command-palette {
  width: 100%;
  max-width: 580px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: commandPaletteIn 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.command-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.command-palette-search .search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
}

.command-palette-input::placeholder {
  color: var(--text-muted);
}

.command-palette-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.command-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.command-group-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  font-size: 13px;
}

.command-item:hover,
.command-item.selected {
  background: var(--accent-glow-sm);
  color: var(--text-primary);
}

.command-item.selected {
  background: var(--accent-glow);
}

.command-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.command-item:hover .command-item-icon,
.command-item.selected .command-item-icon {
  background: var(--accent-glow);
  color: var(--accent);
}

.command-item-text { flex: 1; }
.command-item-shortcut {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

.command-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.command-footer-item {
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ===================================================
   PILL FILTERS
   =================================================== */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition-fast);
  font-family: 'DM Sans', sans-serif;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-overlay);
}

.pill.active {
  background: var(--accent-glow);
  border-color: rgba(79, 142, 247, 0.4);
  color: var(--accent);
}


/* ===================================================
   PROGRESS BAR
   =================================================== */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), #16a34a); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #d97706); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #dc2626); }


/* ===================================================
   DIVIDER COM TEXTO
   =================================================== */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 8px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ===================================================
   TOOLTIP
   =================================================== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateX(-50%) translateY(4px);
  box-shadow: var(--shadow-md);
  z-index: 999;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
