/* ============================================================
   InfoAi — Select2 + Perfect Scrollbar theme
   ============================================================ */

/* ---------- Select2 (InfoAi) ---------- */
.select2-container {
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 0.9rem !important;
}

.select2-container--default .select2-selection--single {
  height: auto !important;
  min-height: 46px;
  border: 1px solid #e8e4f0 !important;
  border-radius: 14px !important;
  background: #fff !important;
  padding: 0.45rem 0.85rem !important;
  display: flex !important;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #1e1b4b !important;
  line-height: 1.4 !important;
  padding: 0 1.5rem 0 0 !important;
  font-weight: 500;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #94a3b8 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: 0.55rem !important;
  width: 22px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #8b5cf6 transparent transparent transparent !important;
  border-width: 6px 5px 0 5px !important;
  margin-top: -3px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #8b5cf6 transparent !important;
  border-width: 0 5px 6px 5px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12) !important;
  outline: none;
}

.select2-dropdown {
  border: 1px solid #e8e4f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 36px rgba(30, 27, 75, 0.1) !important;
  overflow: hidden;
  z-index: 2000 !important;
}

.select2-container--default .select2-search--dropdown {
  padding: 0.55rem 0.65rem !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #e8e4f0 !important;
  border-radius: 10px !important;
  padding: 0.5rem 0.7rem !important;
  outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.select2-container--default .select2-results__option {
  padding: 0.65rem 0.9rem !important;
  font-size: 0.88rem;
  color: #1e1b4b;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6) !important;
  color: #fff !important;
}

.select2-container--default .select2-results__option--selected {
  background: #f5f3ff !important;
  color: #4c1d95 !important;
  font-weight: 600;
}

.select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6) !important;
  color: #fff !important;
}

/* Compact / pill selects (período, paginação) */
.select2-container.select2--compact .select2-selection--single {
  min-height: 40px;
  border-radius: 9999px !important;
  padding: 0.35rem 0.85rem !important;
  font-weight: 600;
  font-size: 0.85rem;
}

.select2-container.select2--compact .select2-selection--single .select2-selection__rendered {
  font-weight: 600;
  font-size: 0.85rem;
}

/* Form error state (afiliados) */
.form-field .select2-container--default .select2-selection--single.is-invalid,
.select2-container--default .select2-selection--single.is-invalid,
.form-field.is-invalid .select2-container--default .select2-selection--single {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.select2-container {
  max-width: 100%;
}

/* ---------- Perfect Scrollbar — fino e bem leve ---------- */
.ps-scroll {
  position: relative;
}

.ps-scroll.ps-ready,
.ps {
  overflow: hidden !important;
}

/* Trilho: só o thumb aparece no hover/scroll — sem “barra fantasma” */
.ps__rail-y,
.ps__rail-x {
  z-index: 20;
  opacity: 0 !important;
  transition: opacity 0.18s ease !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.ps:hover > .ps__rail-y,
.ps:hover > .ps__rail-x,
.ps--active-y:hover > .ps__rail-y,
.ps--active-x:hover > .ps__rail-x,
.ps--scrolling-y > .ps__rail-y,
.ps--scrolling-x > .ps__rail-x,
.ps__rail-y:hover,
.ps__rail-y.ps--clicking,
.ps__rail-x:hover,
.ps__rail-x.ps--clicking {
  opacity: 1 !important;
  background: transparent !important;
}

.ps__rail-y {
  width: 6px !important;
  right: 1px !important;
}

.ps__rail-x {
  height: 6px !important;
  bottom: 1px !important;
}

/* Thumb bem fino e cor suave */
.ps__thumb-y {
  width: 3px !important;
  right: 1.5px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.4) !important;
}

.ps__thumb-y:hover,
.ps__rail-y:hover > .ps__thumb-y,
.ps__rail-y.ps--clicking .ps__thumb-y {
  width: 4px !important;
  background: rgba(148, 163, 184, 0.6) !important;
}

.ps__thumb-x {
  height: 3px !important;
  bottom: 1.5px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.4) !important;
}

.ps__thumb-x:hover,
.ps__rail-x:hover > .ps__thumb-x,
.ps__rail-x.ps--clicking .ps__thumb-x {
  height: 4px !important;
  background: rgba(148, 163, 184, 0.6) !important;
}

/* Nativo fino (sidebar / fallback) */
.ps-scroll:not(.ps-ready),
.ps-native {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.ps-scroll:not(.ps-ready)::-webkit-scrollbar,
.ps-native::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.ps-scroll:not(.ps-ready)::-webkit-scrollbar-track,
.ps-native::-webkit-scrollbar-track {
  background: transparent;
}
.ps-scroll:not(.ps-ready)::-webkit-scrollbar-thumb,
.ps-native::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
.ps-scroll:not(.ps-ready)::-webkit-scrollbar-thumb:hover,
.ps-native::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

/* Main content area uses PS when ready */
.main.ps-scroll.ps-ready {
  overflow: hidden !important;
}

/* Sidebar: NUNCA Perfect Scroll — só nativo fino */
.sidebar__nav-scroll,
.sidebar .ps-scroll.ps-native,
.sidebar__nav-scroll.ps-native {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
.sidebar .ps__rail-y,
.sidebar .ps__rail-x {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---------- File attachments (typed) ---------- */
.file-list__item {
  gap: 0.6rem;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  background: #fff;
  font-size: 0.82rem;
  color: #64748b;
  min-width: 0;
}

.file-chip__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #fff;
  overflow: hidden;
}

.file-chip__icon--image {
  background: linear-gradient(135deg, #f97316, #fb923c);
  padding: 0;
}

.file-chip__icon--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-chip__icon--pdf {
  background: linear-gradient(135deg, #dc2626, #f87171);
}

.file-chip__icon--doc {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.file-chip__icon--sheet {
  background: linear-gradient(135deg, #059669, #34d399);
}

.file-chip__icon--text {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.file-chip__icon--file {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

.file-chip__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.file-chip__name {
  font-weight: 600;
  color: #1e1b4b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-chip__type {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.file-chip__remove {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.file-chip__remove:hover {
  color: #ef4444;
  background: #fef2f2;
}

.mail-msg__file {
  gap: 0.4rem;
}

.mail-msg__file-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.mail-msg__file-icon--image { background: #f97316; }
.mail-msg__file-icon--pdf { background: #dc2626; }
.mail-msg__file-icon--doc { background: #2563eb; }
.mail-msg__file-icon--sheet { background: #059669; }
.mail-msg__file-icon--text { background: #64748b; }
.mail-msg__file-icon--file { background: #6d28d9; }
