/* app/static/css/custom.css */

/* =========================================================
   TOKENS (Light / Dark)
   - Usamos os 2 atributos: data-theme e data-bs-theme
   - data-bs-theme é o que faz o Bootstrap 5.3 "virar" dark
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --text: #000;
  --muted: #64748b;

  --surface-0: rgba(255, 255, 255, 0);
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: rgba(255, 255, 255, .88);

  --border: rgba(15, 23, 42, .10);
  --border-strong: rgba(15, 23, 42, .16);
  --shadow-1: 0 10px 25px rgba(15, 23, 42, .06);

  --accent: #106EBE;
  --accent-2: #3b82f6;
  --ring: rgba(16, 110, 190, .18);

  --sidebar-bg: rgba(15, 23, 42, .92);
  --sidebar-text: rgba(255, 255, 255, .90);
  --sidebar-muted: rgba(255, 255, 255, .62);
  --sidebar-active: rgba(16, 110, 190, .35);
  --sidebar-border: rgba(255, 255, 255, .08);

  --input-bg: #ffffff;
  --input-text: #000;
  --input-placeholder: rgba(15, 23, 42, .45);
  --input-border: rgba(15, 23, 42, .14);

  --word-bg: #ffffff;
  --word-text: #111827;
  --word-border: rgba(15, 23, 42, .10);

  /* Bootstrap vars base (light) */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: rgba(100, 116, 139, .72);
  --bs-link-color: #2563eb;
  --bs-link-hover-color: #1d4ed8;
}

:root[data-theme="dark"],
:root[data-bs-theme="dark"],
html[data-theme="dark"],
html[data-bs-theme="dark"] {
  --bg: #0b1220;
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .68);

  --surface-0: rgba(255, 255, 255, 0);
  --surface-1: rgba(255, 255, 255, .06);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-3: rgba(10, 15, 24, .80);

  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .14);
  --shadow-1: 0 14px 34px rgba(0, 0, 0, .45);

  --accent: #14B8A6;
  --accent-2: #8ab4ff;
  --ring: rgba(138, 180, 255, .18);

  --sidebar-bg: rgba(0, 0, 0, .45);
  --sidebar-text: rgba(255, 255, 255, .90);
  --sidebar-muted: rgba(255, 255, 255, .62);
  --sidebar-active: rgba(16, 110, 190, .40);
  --sidebar-border: rgba(255, 255, 255, .10);

  --input-bg: rgba(255, 255, 255, .05);
  --input-text: rgba(255, 255, 255, .92);
  --input-placeholder: rgba(255, 255, 255, .45);
  --input-border: rgba(255, 255, 255, .14);

  --word-bg: rgba(255, 255, 255, .04);
  --word-text: rgba(255, 255, 255, .92);
  --word-border: rgba(255, 255, 255, .12);

  /* Bootstrap vars (dark) */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-secondary-color: rgba(255, 255, 255, .72);
  --bs-tertiary-color: rgba(255, 255, 255, .62);
  --bs-link-color: var(--accent-2);
  --bs-link-hover-color: rgba(138, 180, 255, .92);
}

/* =========================================================
   BASE
   ========================================================= */

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(16, 110, 190, .12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(59, 130, 246, .10), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.text-muted {
  color: var(--muted) !important;
}

hr {
  opacity: .12;
}

/* =========================================================
   CARDS / LIST GROUP
   ========================================================= */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  color: var(--text);
}

.shadow-sm {
  box-shadow: var(--shadow-1) !important;
}

.list-group-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  color: var(--text);
}

/* =========================================================
   BUTTONS / BADGES
   ========================================================= */

.btn {
  border-radius: 12px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
}

.badge {
  border-radius: 999px;
}

.badge-accent {
  background: rgba(16, 110, 190, .14);
  border: 1px solid rgba(16, 110, 190, .25);
  color: var(--text);
}

/* =========================================================
   FORMS / INPUTS (resolve branco + texto sumindo)
   ========================================================= */

.form-control,
.form-select,
textarea,
input {
  border-radius: 12px;
}

.form-control,
.form-select,
.input-group-text {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid var(--input-border) !important;
}

.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
  color: var(--input-placeholder) !important;
}

/* Readonly/disabled também precisam virar escuro no chat/settings */
.form-control[readonly],
.form-control:disabled,
.form-select:disabled,
textarea[readonly],
textarea:disabled {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  opacity: 1;
}

/* Labels: no dark devem ser claros; no light, muted */
label,
.form-label,
.col-form-label {
  color: var(--muted) !important;
}

:root[data-theme="dark"] label,
:root[data-bs-theme="dark"] label,
html[data-theme="dark"] label,
html[data-bs-theme="dark"] label,
:root[data-theme="dark"] .form-label,
:root[data-bs-theme="dark"] .form-label,
html[data-theme="dark"] .form-label,
html[data-bs-theme="dark"] .form-label,
:root[data-theme="dark"] .col-form-label,
:root[data-bs-theme="dark"] .col-form-label,
html[data-theme="dark"] .col-form-label,
html[data-bs-theme="dark"] .col-form-label {
  color: rgba(255, 255, 255, .78) !important;
}

.form-text {
  color: var(--muted) !important;
}

:root[data-theme="dark"] .form-text,
:root[data-bs-theme="dark"] .form-text,
html[data-theme="dark"] .form-text,
html[data-bs-theme="dark"] .form-text {
  color: rgba(255, 255, 255, .62) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(138, 180, 255, .55) !important;
  box-shadow: 0 0 0 .25rem var(--ring) !important;
}

/* Checkbox/radio no dark */
:root[data-theme="dark"] .form-check-input,
:root[data-bs-theme="dark"] .form-check-input,
html[data-theme="dark"] .form-check-input,
html[data-bs-theme="dark"] .form-check-input {
  background-color: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
}

/* =========================================================
   BOOTSTRAP HARD-CODES (bg-light/bg-white/text-dark)
   ========================================================= */

:root[data-theme="dark"] .bg-white,
:root[data-bs-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-white,
:root[data-theme="dark"] .bg-light,
:root[data-bs-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-light,
html[data-bs-theme="dark"] .bg-light {
  background: var(--surface-1) !important;
}

:root[data-theme="dark"] .text-dark,
:root[data-bs-theme="dark"] .text-dark,
html[data-theme="dark"] .text-dark,
html[data-bs-theme="dark"] .text-dark {
  color: var(--text) !important;
}

/* =========================================================
   TABLES
   ========================================================= */

.table {
  color: var(--text);
}

.table thead th {
  color: rgba(15, 23, 42, .82);
  border-color: rgba(15, 23, 42, .12);
}

:root[data-theme="dark"] .table thead th,
:root[data-bs-theme="dark"] .table thead th,
html[data-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .table thead th {
  color: rgba(255, 255, 255, .82);
  border-color: rgba(255, 255, 255, .12);
}

.table tbody td {
  border-color: rgba(15, 23, 42, .08);
}

:root[data-theme="dark"] .table tbody td,
:root[data-bs-theme="dark"] .table tbody td,
html[data-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .table tbody td {
  border-color: rgba(255, 255, 255, .08);
}

:root[data-theme="dark"] .table tbody tr:nth-child(odd),
:root[data-bs-theme="dark"] .table tbody tr:nth-child(odd),
html[data-theme="dark"] .table tbody tr:nth-child(odd),
html[data-bs-theme="dark"] .table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, .02);
}

:root[data-theme="dark"] .table tbody tr:hover,
:root[data-bs-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] .table tbody tr:hover,
html[data-bs-theme="dark"] .table tbody tr:hover {
  background: rgba(138, 180, 255, .08);
}

/* =========================================================
   MODALS / DROPDOWNS / ALERTS
   ========================================================= */

.modal-content,
.dropdown-menu {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.alert {
  background: rgba(15, 23, 42, .03);
  border-color: rgba(15, 23, 42, .10);
  color: var(--text);
}

:root[data-theme="dark"] .alert,
:root[data-bs-theme="dark"] .alert,
html[data-theme="dark"] .alert,
html[data-bs-theme="dark"] .alert {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .88);
}

/* =========================================================
   “WORD PAGE”
   ========================================================= */

.word-page {
  background: var(--word-bg);
  border: 1px solid var(--word-border);
  border-radius: 16px;
  padding: 28px;
  min-height: 640px;
  color: var(--word-text);
}

.sec-title {
  font-weight: 800;
  color: var(--word-text);
  margin-bottom: 8px;
}

.sec-body {
  color: var(--word-text);
  font-size: .95rem;
  line-height: 1.45rem;
}

/* =========================================================
   RECORDING DOT
   ========================================================= */

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .6);
  animation: pulse 1.2s infinite;
  display: inline-block;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .6);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* =========================================================
   PATCH: classes hardcoded do Bootstrap que ficam brancas
   ========================================================= */

:root[data-bs-theme="dark"] .bg-white,
:root[data-theme="dark"] .bg-white,
:root[data-bs-theme="dark"] .bg-light,
:root[data-theme="dark"] .bg-light {
  background: var(--surface-1) !important;
}

:root[data-bs-theme="dark"] .text-dark,
:root[data-theme="dark"] .text-dark {
  color: var(--text) !important;
}

/* badges "text-bg-light" ficam claros demais no dark */
:root[data-bs-theme="dark"] .text-bg-light,
:root[data-theme="dark"] .text-bg-light {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

/* inputs/textareas readonly ou "form-control" usados como bloco (ex.: chat) */
:root[data-bs-theme="dark"] .form-control,
:root[data-theme="dark"] .form-control,
:root[data-bs-theme="dark"] textarea,
:root[data-theme="dark"] textarea {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
}

/* garante títulos dentro de cards (ex.: "Nova consulta") */
:root[data-bs-theme="dark"] h1,
:root[data-bs-theme="dark"] h2,
:root[data-bs-theme="dark"] h3,
:root[data-bs-theme="dark"] h4,
:root[data-bs-theme="dark"] h5,
:root[data-bs-theme="dark"] h6,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6 {
  color: var(--text) !important;
}

/* ===== Assistant layout ===== */
.assistant-shell {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 110px);
  /* ajusta conforme sua topbar */
}

.assistant-side {
  width: 300px;
  border-right: 1px solid rgba(15, 23, 42, .10);
  padding: 14px;
  background: #f7f7f8;
}

.assistant-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 18px;
}

/* Sidebar items */
.assistant-new {
  border-radius: 12px;
  padding: 10px 12px;
}

.assistant-chatlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.assistant-chatitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
}

.assistant-chatitem.active {
  background: rgba(16, 110, 190, .10);
}

.assistant-chatlink {
  flex: 1;
  text-decoration: none;
  color: #111827;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn-ghost {
  border: 0;
  background: transparent;
}

.btn-primary3 {
  background: linear-gradient(135deg, var(--brand) 0%, #14B8A6 100%);
  border: none;

  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-focus-color: #fff;
}

.btn-primary3:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 110, 190, 0.3);
}

/* ===== Empty state (ChatGPT-like) ===== */
.assistant-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 10px;
}

.assistant-empty h1 {
  font-size: 34px;
  font-weight: 800;
  margin: 0;
  text-align: center;
}

.assistant-suggestions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 760px;
}

.chip {
  border: 1px solid rgba(15, 23, 42, .12);
  background: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
}

/* ===== Thread ===== */
.assistant-thread {
  flex: 1;
  overflow: auto;
  padding: 10px 6px 90px;
  /* espaço pro composer */
  max-width: 860px;
  /* centraliza como ChatGPT */
  width: 100%;
  margin: 0 auto;
}

.msg-row {
  display: flex;
  margin: 10px 0;
}

.msg-row.me {
  justify-content: flex-end;
}

.msg-row.bot {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 18px;
  background: #f3f4f6;
  /* sem “contorno” */
  color: #111827;
  white-space: pre-wrap;
  line-height: 1.35;
}

.msg-row.me .msg-bubble {
  background: rgba(59, 130, 246, .12);
}

/* ===== Composer ===== */
.assistant-composer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, .90);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.assistant-composer.empty {
  position: static;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
}

.assistant-input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 10px 12px;
  font-size: 15px;
  background: transparent;
}

.assistant-send {
  border: 0;
  background: #106EBE;
  color: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
}

.assistant-newbig {
  border: 0;
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
}

/* --- Pacientes (painel lateral na Nova Consulta) --- */
.patient-panel {
  position: sticky;
  top: 1rem;
}

.mini-timeline {
  max-height: 280px;
  overflow: auto;
}

.mini-timeline-list {
  padding-left: 1.1rem;
  margin: 0;
}

.mini-timeline-list li {
  margin-bottom: .35rem;
}

::selection {
  background: var(--brand) !important;
  color: white;
}

::-moz-selection {
  background: var(--brand) !important;
  color: white;
}

.modal-backdrop.show {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background-color: rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .modal-backdrop.show,
[data-bs-theme="dark"] .modal-backdrop.show {
  background-color: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.modal-content {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-content {
  background: rgba(30, 41, 59, 0.9) !important;
}

/* Logo (login/register) */
.brand-logo {
  max-height: 56px;
  max-width: 220px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
}

.btn-outline-secondary-global {
  color: #495057;
  border-color: #252525;
  background-color: transparent;
}

.btn-check:checked+.btn-outline-secondary-global {
  color: white !important;
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
}

.btn-outline-secondary-global:hover {
  background-color: rgba(16, 110, 190, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline-secondary-global:focus,
.btn-outline-secondary-global:active,
.btn-outline-secondary-global.active {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 0 0 0.25rem rgba(16, 110, 190, 0.25) !important;
}


[data-theme="dark"] .btn-outline-secondary-global,
[data-bs-theme="dark"] .btn-outline-secondary-global {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .btn-check:checked+.btn-outline-secondary-global,
[data-bs-theme="dark"] .btn-check:checked+.btn-outline-secondary-global {
  color: white !important;
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
}

[data-theme="dark"] .btn-outline-secondary-global:hover,
[data-bs-theme="dark"] .btn-outline-secondary-global-:hover {
  background-color: rgba(16, 110, 190, 0.2);
  border-color: var(--brand);
  color: white;
}

/* SCROLLBAR GLOBAL - VERSÃO ULTRA FORÇADA */
html {
  scrollbar-width: thin !important;
  scrollbar-color: var(--brand) var(--border) !important;
}

html::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
}

html::-webkit-scrollbar-track {
  background: var(--border) !important;
  border-radius: 4px !important;
}

html::-webkit-scrollbar-thumb {
  background: var(--brand) !important;
  border-radius: 4px !important;
  opacity: 0.5 !important;
  border: 0 solid transparent !important;
  background-clip: padding-box !important;
}

html::-webkit-scrollbar-thumb:hover {
  background: #14B8A6 !important;
  opacity: 0.5 !important;
}

html::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* TODOS os elementos - seletor universal com força máxima */
*,
*::before,
*::after {
  scrollbar-width: thin !important;
  scrollbar-color: var(--brand) var(--border) !important;
}

*::-webkit-scrollbar,
*::before::-webkit-scrollbar,
*::after::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
  -webkit-appearance: none !important;
}

*::-webkit-scrollbar-track,
*::before::-webkit-scrollbar-track,
*::after::-webkit-scrollbar-track {
  background: var(--border) !important;
  border-radius: 4px !important;
}

*::-webkit-scrollbar-thumb,
*::before::-webkit-scrollbar-thumb,
*::after::-webkit-scrollbar-thumb {
  background: var(--brand) !important;
  border-radius: 4px !important;
  opacity: 0.5 !important;
  border: 0 solid transparent !important;
  background-clip: padding-box !important;
}

*::-webkit-scrollbar-thumb:hover,
*::before::-webkit-scrollbar-thumb:hover,
*::after::-webkit-scrollbar-thumb:hover {
  background: #14B8A6 !important;
  opacity: 0.5 !important;
}

*::-webkit-scrollbar-corner,
*::before::-webkit-scrollbar-corner,
*::after::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Dark mode */
[data-theme="dark"] *::-webkit-scrollbar-track,
[data-bs-theme="dark"] *::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] *::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] *::-webkit-scrollbar-thumb {
  background: var(--brand) !important;
  opacity: 0.5 !important;
}

[data-theme="dark"] *::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: #14B8A6 !important;
  opacity: 0.5 !important;
}

/* Override específico para elementos comuns que podem ter scroll */
body,
main,
section,
div,
article,
aside,
nav,
header,
footer,
form,
.modal-content,
.dropdown-menu,
.card,
.list-group,
.table-responsive {
  scrollbar-width: thin !important;
  scrollbar-color: var(--brand) var(--border) !important;
}

body::-webkit-scrollbar,
main::-webkit-scrollbar,
section::-webkit-scrollbar,
div::-webkit-scrollbar,
article::-webkit-scrollbar,
aside::-webkit-scrollbar,
nav::-webkit-scrollbar,
header::-webkit-scrollbar,
footer::-webkit-scrollbar,
form::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.card::-webkit-scrollbar,
.list-group::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

body::-webkit-scrollbar-track,
main::-webkit-scrollbar-track,
section::-webkit-scrollbar-track,
div::-webkit-scrollbar-track,
article::-webkit-scrollbar-track,
aside::-webkit-scrollbar-track,
nav::-webkit-scrollbar-track,
header::-webkit-scrollbar-track,
footer::-webkit-scrollbar-track,
form::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
.card::-webkit-scrollbar-track,
.list-group::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
  background: var(--border) !important;
  border-radius: 4px !important;
}

body::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb,
section::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb,
article::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb,
nav::-webkit-scrollbar-thumb,
header::-webkit-scrollbar-thumb,
footer::-webkit-scrollbar-thumb,
form::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.card::-webkit-scrollbar-thumb,
.list-group::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--brand) !important;
  border-radius: 4px !important;
  opacity: 0.5 !important;
}

body::-webkit-scrollbar-thumb:hover,
main::-webkit-scrollbar-thumb:hover,
section::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover,
article::-webkit-scrollbar-thumb:hover,
aside::-webkit-scrollbar-thumb:hover,
nav::-webkit-scrollbar-thumb:hover,
header::-webkit-scrollbar-thumb:hover,
footer::-webkit-scrollbar-thumb:hover,
form::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.dropdown-menu::-webkit-scrollbar-thumb:hover,
.card::-webkit-scrollbar-thumb:hover,
.list-group::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #14B8A6 !important;
  opacity: 0.5 !important;
}

[data-theme="dark"] .theme-toggle-modern i,
[data-bs-theme="dark"] .theme-toggle-modern i {
  color: #ffffff !important;
}

/* Transição global para tudo que é interativo */
a,
button,
.btn,
.menu-item,
.card,
input,
select,
textarea {
  transition: all 0.2s ease-in-out !important;
}


/* Remove outline padrão e adiciona um glow roxo suave */
*:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(16, 110, 190, 0.25) !important;
}

/* Mas mantém outline para usuários de teclado (acessibilidade) */
*:focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
}

::placeholder {
  color: var(--sidebar-muted);
  opacity: 0.7;
  font-style: italic;
  transition: opacity 0.2s;
}

input:focus::placeholder {
  opacity: 0.4;
}

.btn:active {
  transform: scale(0.97) !important;
}

.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-check:checked+.btn-outline-secondary {
  background-color: #106EBE !important;
  border-color: #106EBE !important;
  color: #fff !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked+.btn-outline-primary {
  background-color: #106EBE !important;
  border-color: #106EBE !important;
  color: #fff !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.card {
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.card:nth-child(1) {
  animation-delay: 0.15s;
}

.card:nth-child(2) {
  animation-delay: 0.3s;
}

.card:nth-child(3) {
  animation-delay: 0.45s;
}

.card:nth-child(4) {
  animation-delay: 0.6s;
}

.card:nth-child(5) {
  animation-delay: 0.75s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.force-scrollbar {
  overflow-y: scroll !important;
  /* Força a barra sempre visível */
}

.force-scrollbar-auto {
  overflow-y: auto !important;
  /* Barra aparece quando necessário */
  scrollbar-width: thin !important;
}