/* Estilos da app — o Tailwind compilado carrega-se em layout (tailwind.css). */
/* Para recompilar: npm run css:build (a partir da pasta do projeto). */

[x-cloak] {
  display: none !important;
}

.app-shell {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: hsl(var(--background));
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, hsl(var(--primary) / 0.09), transparent 55%),
    radial-gradient(ellipse 90% 50% at 100% 0%, hsl(217 91% 50% / 0.05), transparent 45%),
    radial-gradient(ellipse 70% 40% at 0% 100%, hsl(214 32% 91% / 0.5), transparent 50%);
  background-attachment: fixed;
}

/* Navegação em pílulas (CSS puro — funciona sem recompilar Tailwind) */
.nav-pill {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-pill:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.nav-pill-active {
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 25%,
    hsl(var(--muted) / 0.5) 50%,
    hsl(var(--muted)) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

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

/* Focus visible improvements */
.focus-visible-ring {
  @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
}

/* Custom checkbox styles */
.custom-checkbox {
  @apply h-4 w-4 rounded border border-primary text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2;
}

/* Custom radio styles */
.custom-radio {
  @apply h-4 w-4 rounded-full border border-primary text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2;
}

/* File input styles */
.file-input {
  @apply flex h-10 w-full rounded-md border border-input bg-background text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50;
}

/* Select styles */
.custom-select {
  @apply flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50;
}

/* Textarea styles */
.custom-textarea {
  @apply flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50;
}

/* Form validation styles */
.form-error {
  @apply text-destructive text-sm font-medium flex items-center gap-1;
}

.form-success {
  @apply text-green-600 text-sm font-medium flex items-center gap-1;
}

.form-warning {
  @apply text-yellow-600 text-sm font-medium flex items-center gap-1;
}

/* Navigation styles */
.nav-link {
  @apply text-muted-foreground hover:text-foreground transition-colors;
}

.nav-link-active {
  @apply text-primary;
}

/* Table responsive */
.table-responsive {
  @apply overflow-x-auto -mx-4 px-4;
}

@media (min-width: 640px) {
  .table-responsive {
    @apply overflow-x-visible mx-0 px-0;
  }
}

/* Card grid layouts */
.card-grid {
  @apply grid gap-4;
}

.card-grid-cols-1 {
  @apply grid-cols-1;
}

.card-grid-cols-2 {
  @apply grid-cols-1 sm:grid-cols-2;
}

.card-grid-cols-3 {
  @apply grid-cols-1 md:grid-cols-2 lg:grid-cols-3;
}

.card-grid-cols-4 {
  @apply grid-cols-1 md:grid-cols-2 lg:grid-cols-4;
}

/* Status indicators */
.status-indicator {
  @apply inline-flex items-center gap-2 text-sm;
}

.status-online {
  @apply text-green-600;
}

.status-offline {
  @apply text-red-600;
}

.status-pending {
  @apply text-yellow-600;
}

/* Progress bar styles */
.progress-bar {
  @apply w-full bg-secondary rounded-full h-2;
}

.progress-fill {
  @apply bg-primary h-2 rounded-full transition-all duration-300 ease-out;
}

/* Tooltip styles */
.tooltip {
  @apply absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg pointer-events-none;
}

/* Dropdown styles */
.dropdown {
  @apply absolute z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2;
}

/* Alert styles */
.alert {
  @apply relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground;
}

.alert-default {
  @apply bg-background text-foreground border-border;
}

.alert-success {
  @apply border-green-200 text-green-800 bg-green-50 [&>svg]:text-green-600;
}

.alert-error {
  @apply border-red-200 text-red-800 bg-red-50 [&>svg]:text-red-600;
}

.alert-warning {
  @apply border-yellow-200 text-yellow-800 bg-yellow-50 [&>svg]:text-yellow-600;
}

.alert-info {
  @apply border-blue-200 text-blue-800 bg-blue-50 [&>svg]:text-blue-600;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .alert-success {
    @apply border-green-800 text-green-200 bg-green-950 [&>svg]:text-green-400;
  }
  
  .alert-error {
    @apply border-red-800 text-red-200 bg-red-950 [&>svg]:text-red-400;
  }
  
  .alert-warning {
    @apply border-yellow-800 text-yellow-200 bg-yellow-950 [&>svg]:text-yellow-400;
  }
  
  .alert-info {
    @apply border-blue-800 text-blue-200 bg-blue-950 [&>svg]:text-blue-400;
  }
}

/* Print optimizations */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  .print-break-before {
    page-break-before: always;
  }
  
  .print-break-after {
    page-break-after: always;
  }
  
  .print-break-inside-avoid {
    page-break-inside: avoid;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .btn {
    @apply border-2;
  }
  
  .card {
    @apply border-2;
  }
  
  .input {
    @apply border-2;
  }
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .container {
    @apply px-4;
  }
  
  .btn-lg {
    @apply px-6;
  }
  
  .card {
    @apply rounded-lg;
  }
}

/* Telemóvel: alvos de toque (~44px), navegação em fila com scroll, toast com safe-area */
@media (max-width: 639px) {
  .nav-pill {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-main-nav--mobile-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.375rem;
    padding-bottom: 0.25rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
  }

  .app-main-nav--mobile-scroll::-webkit-scrollbar {
    height: 4px;
  }

  .app-main-nav--mobile-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: hsl(var(--muted-foreground) / 0.35);
  }

  .app-toast-fixed {
    right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    left: auto;
    max-width: min(100vw - 1.5rem, 28rem);
  }
}

@supports (height: 100dvh) {
  .app-shell {
    min-height: 100dvh;
  }
}

/* Conteúdo e cabeçalho respeitam entalhe / barra inicial (iOS) */
@media (max-width: 639px) {
  .app-shell > header {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  }

  .app-main {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
}

dialog.app-dialog-safe {
  margin: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  max-height: calc(100vh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

@supports (height: 100dvh) {
  dialog.app-dialog-safe {
    max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}

/* -------------------------------------------------------------------------- */
/* Dashboard — layout próprio (CSS puro; não depende do purge do Tailwind)    */
/* -------------------------------------------------------------------------- */

.dash-page {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.125rem;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.75rem;
  color: #f8fafc;
  background: linear-gradient(
    125deg,
    #0f172a 0%,
    #1e3a5f 38%,
    #1d4ed8 78%,
    #0e7490 100%
  );
  box-shadow:
    0 24px 48px -18px rgba(15, 23, 42, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dash-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(14, 165, 233, 0.2), transparent 50%);
  pointer-events: none;
}

.dash-hero-inner {
  position: relative;
  z-index: 1;
}

.dash-hero-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
  margin: 0 0 0.5rem;
}

.dash-hero-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.dash-hero-sub {
  margin: 0.65rem 0 0;
  max-width: 32rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.88);
}

.dash-kpis {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .dash-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 8.5rem;
  padding: 1.25rem 1.25rem 1.35rem;
  border-radius: 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.dash-kpi:hover {
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.18);
  transform: translateY(-2px);
}

.dash-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 4px;
  border-radius: 999px;
  background: var(--dash-accent, hsl(var(--primary)));
}

.dash-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-left: 0.35rem;
}

.dash-kpi-label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.dash-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  flex-shrink: 0;
  background: var(--dash-icon-bg, hsl(var(--muted)));
  color: var(--dash-icon-fg, hsl(var(--foreground)));
}

.dash-kpi-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.dash-kpi-value {
  margin: 1rem 0 0;
  padding-left: 0.35rem;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--dash-value-color, hsl(var(--foreground)));
}

.dash-kpi-hint {
  margin: 0.35rem 0 0;
  padding-left: 0.35rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.dash-kpi--total {
  --dash-accent: #64748b;
  --dash-icon-bg: #f1f5f9;
  --dash-icon-fg: #475569;
}

.dash-kpi--ativos {
  --dash-accent: #059669;
  --dash-icon-bg: #ecfdf5;
  --dash-icon-fg: #047857;
  --dash-value-color: #047857;
}

.dash-kpi--receita {
  --dash-accent: #d97706;
  --dash-icon-bg: #fffbeb;
  --dash-icon-fg: #b45309;
}

.dash-kpi--conv {
  --dash-accent: #7c3aed;
  --dash-icon-bg: #f5f3ff;
  --dash-icon-fg: #6d28d9;
}

.dash-actions-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: hsl(var(--foreground));
}

.dash-actions-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .dash-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.dash-action:hover {
  box-shadow: 0 14px 32px -14px rgba(15, 23, 42, 0.2);
  transform: translateY(-2px);
  border-color: var(--dash-a-border, hsl(var(--border)));
}

.dash-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  flex-shrink: 0;
  color: #fff;
  background: var(--dash-a-bg, hsl(var(--primary)));
  box-shadow: 0 4px 14px -4px var(--dash-a-glow, rgba(37, 99, 235, 0.45));
}

.dash-action-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.dash-action-body {
  flex: 1;
  min-width: 0;
}

.dash-action-title {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
}

.dash-action-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.dash-action-arrow {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: #cbd5e1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.dash-action:hover .dash-action-arrow {
  transform: translateX(3px);
  color: var(--dash-a-arrow, hsl(var(--primary)));
}

.dash-action--blue {
  --dash-a-bg: #2563eb;
  --dash-a-glow: rgba(37, 99, 235, 0.5);
  --dash-a-border: rgba(37, 99, 235, 0.35);
  --dash-a-arrow: #2563eb;
}

.dash-action--indigo {
  --dash-a-bg: #4f46e5;
  --dash-a-glow: rgba(79, 70, 229, 0.45);
  --dash-a-border: rgba(79, 70, 229, 0.35);
  --dash-a-arrow: #4f46e5;
}

.dash-action--teal {
  --dash-a-bg: #0d9488;
  --dash-a-glow: rgba(13, 148, 136, 0.45);
  --dash-a-border: rgba(13, 148, 136, 0.35);
  --dash-a-arrow: #0d9488;
}

.dash-action--violet {
  --dash-a-bg: #7c3aed;
  --dash-a-glow: rgba(124, 58, 237, 0.45);
  --dash-a-border: rgba(124, 58, 237, 0.35);
  --dash-a-arrow: #7c3aed;
}

@media (min-width: 1024px) {
  .dash-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .dash-action--teal {
    grid-column: span 2;
  }
}

.dash-foot {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.85;
}

/* -------------------------------------------------------------------------- */
/* Mensalidades / Campanhas — fluxo em passos (alinhado ao dashboard)         */
/* -------------------------------------------------------------------------- */

.pctrim-hero--mens.dash-hero {
  background: linear-gradient(
    125deg,
    #0f172a 0%,
    #1e1b4b 38%,
    #4338ca 72%,
    #0f766e 100%
  );
}

.pctrim-hero--camp.dash-hero {
  background: linear-gradient(
    125deg,
    #052e16 0%,
    #14532d 42%,
    #059669 78%,
    #0369a1 100%
  );
}

.pctrim-flow-step {
  position: relative;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  padding: 1.35rem 1.5rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.pctrim-flow-step-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.pctrim-flow-step-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.9375rem;
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pctrim-flow-step-title {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.pctrim-flow-step-desc {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}

.pctrim-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.pctrim-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  background: hsl(var(--muted) / 0.25);
  border-radius: 0.75rem;
  border: 1px dashed hsl(var(--border));
}

.pctrim-empty svg {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.45;
  color: hsl(var(--muted-foreground));
}

.pctrim-data-table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.pctrim-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.pctrim-data-table thead th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.45);
  border-bottom: 1px solid hsl(var(--border));
}

.pctrim-data-table tbody td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
}

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

.pctrim-data-table tbody tr:hover td {
  background: hsl(var(--muted) / 0.2);
}

.pctrim-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
  font-size: 0.8125rem;
}

.pctrim-status-line--ok {
  color: #15803d;
}

.pctrim-status-line--err {
  color: #b91c1c;
}

.pctrim-status-line--muted {
  color: hsl(var(--muted-foreground));
}

.pctrim-json-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  max-height: 20rem;
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(222 47% 11%);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.pctrim-json-panel.is-hidden {
  display: none;
}

.pctrim-session-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: hsl(var(--muted) / 0.45);
  border: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
}

.pctrim-session-box code {
  font-size: 0.7rem;
  word-break: break-all;
}

/* Campanhas — fila e contactos */
.pctrim-queue-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  margin-bottom: 1rem;
}

.pctrim-queue-stat {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.pctrim-queue-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin: 0 0 0.25rem;
}

.pctrim-queue-stat-value {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.pctrim-queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pctrim-queue-badge--idle {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.pctrim-queue-badge--run {
  background: #dcfce7;
  color: #166534;
}

.pctrim-queue-progress {
  height: 0.5rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  overflow: hidden;
  margin-top: 0.75rem;
}

.pctrim-queue-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  transition: width 0.35s ease;
}

.pctrim-contacts-list {
  max-height: 18rem;
  overflow-y: auto;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.pctrim-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  cursor: pointer;
  transition: background 0.12s ease;
}

.pctrim-contact-row:last-child {
  border-bottom: none;
}

.pctrim-contact-row:hover {
  background: hsl(var(--muted) / 0.25);
}

.pctrim-contact-row span {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: hsl(var(--foreground));
}

.pctrim-details-raw {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.pctrim-details-raw summary {
  cursor: pointer;
  user-select: none;
  padding: 0.35rem 0;
}

.pctrim-textarea-wrap textarea {
  width: 100%;
  max-width: 42rem;
  min-height: 8rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pctrim-textarea-wrap textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25);
}

.pctrim-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}
