/* ==========================================================================
   Crescer Design System v1
   Carregado DEPOIS de hope-ui / custom / dark / customizer.
   Regra: nas views usar classes Bootstrap + componentes Blade (<x-...>);
   nunca cores, tamanhos ou raios fixos em style="" — usar estes tokens.
   ========================================================================== */

:root {
  /* Marca — verde-azulado do logotipo Crescer (#397d88) + dourado de acento.
     brand-700 = cor primária (contraste 4.7:1 com branco); brand-600 = hover/pressed. */
  --brand-900: #163a41;
  --brand-700: #397d88;           /* primária */
  --brand-600: #2d6872;
  --brand-500: #569b9f;
  --brand-300: #6cb4b7;
  --brand-100: #e1f0f1;
  --brand-50:  #f1f8f8;
  --accent:    #d3a954;           /* dourado do logotipo */

  /* Semânticas */
  --c-success: #146c43;  --c-success-bg: #e1f5e8;
  --c-danger:  #b02a37;  --c-danger-bg:  #fde2e2;
  --c-warning: #8a5a00;  --c-warning-bg: #fff4d6;
  --c-info:    #0a58a8;  --c-info-bg:    #e1effd;

  /* Neutros */
  --n-0:   #ffffff;
  --n-50:  #f7f8fb;
  --n-100: #eef0f5;
  --n-200: #e3e6ee;
  --n-300: #cfd4e0;
  --n-500: #6b7280;
  --n-700: #374151;
  --n-900: #130f26;

  /* Superfícies e texto (mudam no modo escuro) */
  --ds-bg:       var(--n-50);
  --ds-surface:  var(--n-0);
  --ds-border:   var(--n-200);
  --ds-text:     var(--n-900);
  --ds-muted:    var(--n-500);
  --ds-primary:  var(--brand-700);
  --ds-primary-hover: var(--brand-600);
  --ds-focus:    #3b82f6;

  /* Tipografia */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: .75rem;   /* 12px — mínimo permitido */
  --fs-sm: .875rem;  /* 14px */
  --fs-md: 1rem;     /* 16px */
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Forma */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-1: 0 2px 8px rgba(19, 15, 38, .06);
  --shadow-2: 0 8px 24px rgba(19, 15, 38, .10);
  --shadow-3: 0 24px 64px rgba(19, 15, 38, .18);

  /* Espaçamento (escala 4px) */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.5rem; --sp-6: 2rem;

  /* Bootstrap */
  --bs-primary: var(--brand-700);
  --bs-primary-rgb: 57, 125, 136;
  --bs-success: var(--c-success);
  --bs-success-rgb: 25, 135, 84;
  --bs-danger: var(--c-danger);
  --bs-danger-rgb: 220, 53, 69;
  --bs-link-color: var(--brand-600);
  --bs-link-hover-color: var(--brand-900);
  /* Escala do tema Hope UI (customizer.css) redefinida com a cor da marca */
  --bs-primary-tint-90: #ebf2f3;
  --bs-primary-tint-80: #d7e5e7;
  --bs-primary-tint-60: #b0cbcf;
  --bs-primary-tint-40: #88b1b8;
  --bs-primary-tint-20: #6197a0;
  --bs-primary-shade-80: #0b191b;
  --bs-primary-shade-60: #173236;
  --bs-primary-shade-40: #224b52;
  --bs-primary-shade-20: #2e646d;
  --bs-heading-color: var(--n-900);
  --bs-secondary: #5b6478;
  --bs-secondary-rgb: 91, 100, 120;
  --bs-info: #0a58a8;
  --bs-info-rgb: 10, 88, 168;
  --bs-warning: #8a5a00;
  --bs-warning-rgb: 138, 90, 0;
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-md);
}

.dark, [data-bs-theme="dark"] {
  --ds-bg:       #0f1420;
  --ds-surface:  #171e2e;
  --ds-border:   #273048;
  --ds-text:     #e8ecf6;
  --ds-muted:    #9aa5bd;
  --ds-primary:  #6cb4b7;
  --ds-primary-hover: #9ad0d2;
  --brand-100:   #173236;
  --brand-50:    #12262a;
  --c-success-bg: #123524; --c-danger-bg: #3d1a1f; --c-warning-bg: #3b2f10; --c-info-bg: #12304f;
  --c-warning: #f0b84d;
  --c-success: #6fd39a; --c-danger: #ff8a96; --c-info: #7ab8f5;
  --n-0: #171e2e; --n-50: #0f1420; --n-100: #1d2538; --n-200: #273048; --n-300: #364163;
  --n-500: #9aa5bd; --n-700: #cbd3e6; --n-900: #e8ecf6;
  --bs-link-color: #6cb4b7;
  --bs-link-hover-color: #9ad0d2;
}

/* ---- Base ---------------------------------------------------------------- */
body { font-family: var(--font-sans); font-size: var(--fs-md); }
h1, .h1 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
h2, .h2 { font-size: 1.35rem;       font-weight: var(--fw-semibold); }
h3, .h3 { font-size: var(--fs-lg);  font-weight: var(--fw-semibold); }
h4, .h4 { font-size: 1.1rem;        font-weight: var(--fw-semibold); }
small, .small, .text-small { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.fw-semibold { font-weight: var(--fw-semibold) !important; }
.text-muted { color: var(--ds-muted) !important; }

/* Acessibilidade: foco visível e skip-link */
:focus-visible { outline: 3px solid var(--ds-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100000;
  background: var(--ds-primary); color: #fff; padding: .6rem 1rem;
  border-radius: var(--radius-sm); transition: top .15s;
}
.skip-link:focus { top: 8px; color: #fff; }
.visually-hidden-focusable:not(:focus) { position: absolute !important; }

/* ---- Botões -------------------------------------------------------------- */
.btn { font-weight: var(--fw-medium); border-radius: var(--radius-sm); }
.btn-primary {
  --bs-btn-bg: var(--brand-700); --bs-btn-border-color: var(--brand-700); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900); --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--brand-700); --bs-btn-disabled-border-color: var(--brand-700);
  --bs-btn-focus-shadow-rgb: 57, 125, 136;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-700); --bs-btn-border-color: var(--brand-700);
  --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
}
.dark .btn-primary { --bs-btn-bg: #2f7f8b; --bs-btn-border-color: #2f7f8b; --bs-btn-hover-bg: #3a919e; --bs-btn-hover-border-color: #3a919e; }
.dark .btn-outline-primary { --bs-btn-color: #6cb4b7; --bs-btn-border-color: #6cb4b7; --bs-btn-hover-bg: #6cb4b7; --bs-btn-hover-color: #0f1420; }
.btn-icon-text { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* ---- Formulários --------------------------------------------------------- */
.form-label { font-weight: var(--fw-medium); font-size: var(--fs-sm); margin-bottom: var(--sp-1); color: var(--ds-text); }
.form-label .req, .form-label .text-danger { margin-left: 2px; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--ds-border); min-height: 42px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 .2rem rgba(57, 125, 136, .25); }
.invalid-feedback { font-size: var(--fs-sm); }
.form-text { font-size: var(--fs-sm); color: var(--ds-muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--ds-border); }

/* ---- Cartões e cabeçalho de página -------------------------------------- */
.card { border-radius: var(--radius-md); border-color: var(--ds-border); box-shadow: var(--shadow-1); }
.card-header { background: transparent; border-bottom-color: var(--ds-border); }
.card-title { font-size: 1.05rem; font-weight: var(--fw-semibold); margin-bottom: 0; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.page-header .page-title { margin: 0; font-size: 1.1rem; font-weight: var(--fw-semibold); }
.page-header .page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.breadcrumb { font-size: var(--fs-sm); margin-bottom: var(--sp-2); }

/* ---- Tabelas ------------------------------------------------------------- */
.table > :not(caption) > * > * { padding: .7rem .75rem; vertical-align: middle; }
.table thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--ds-muted); font-weight: var(--fw-semibold); white-space: nowrap; }
.empty-state { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--ds-muted); }
.empty-state svg { width: 40px; height: 40px; opacity: .5; margin-bottom: var(--sp-2); }
.action-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: var(--radius-sm); }

/* ---- Badges de estado ---------------------------------------------------- */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: .2rem .65rem; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { background: var(--c-success-bg); color: var(--c-success); }
.status-danger  { background: var(--c-danger-bg);  color: var(--c-danger); }
.status-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.status-info    { background: var(--c-info-bg);    color: var(--c-info); }
.status-neutral { background: var(--n-100);        color: var(--n-700); }
.status-primary { background: var(--brand-100);    color: var(--ds-primary); }

/* ---- Utilitários que substituem style="" -------------------------------- */
.bg-surface { background: var(--ds-surface) !important; }
.border-ds  { border-color: var(--ds-border) !important; }
.text-brand { color: var(--ds-primary) !important; }
.radius-sm { border-radius: var(--radius-sm) !important; }
.radius-md { border-radius: var(--radius-md) !important; }
.radius-lg { border-radius: var(--radius-lg) !important; }
.shadow-ds-1 { box-shadow: var(--shadow-1) !important; }
.shadow-ds-2 { box-shadow: var(--shadow-2) !important; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.pre-wrap { white-space: pre-wrap; }

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .table .btn-sm, .table .action-icon, .btn-sm { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .form-actions .btn { flex: 1 1 auto; }
  .page-header .page-actions { width: 100%; }
  .page-header .page-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- Layout (migrado de app2) ---- */
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* Toasts */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; width: 340px; pointer-events: none; }
.toast-ds { --toast-color: var(--c-info); background: var(--ds-surface); color: var(--ds-text); border-radius: var(--radius-md); box-shadow: var(--shadow-2); display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-left: 4px solid var(--toast-color); opacity: 0; transform: translateX(60px); transition: opacity .35s ease, transform .35s ease; pointer-events: all; position: relative; overflow: hidden; }
.toast-ds.is-visible { opacity: 1; transform: translateX(0); }
.toast-ds--success { --toast-color: var(--c-success); }
.toast-ds--error { --toast-color: var(--c-danger); }
.toast-ds--warning { --toast-color: var(--c-warning); }
.toast-ds--info { --toast-color: var(--c-info); }
.toast-ds__icon { background: var(--toast-color); border-radius: var(--radius-sm); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-ds__icon svg { fill: #fff; }
.toast-ds__body { flex: 1; min-width: 0; }
.toast-ds__title { font-weight: var(--fw-bold); font-size: var(--fs-sm); margin-bottom: 3px; }
.toast-ds__msg { font-size: var(--fs-sm); color: var(--ds-muted); line-height: 1.45; }
.toast-ds__close { background: none; border: none; cursor: pointer; padding: 2px; color: var(--ds-muted); flex-shrink: 0; }
.toast-ds__bar { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--toast-color); width: 100%; transform-origin: left; animation: toastProgress 5s linear forwards; }

/* Modal global de eliminação */
.modal-delete-dialog { max-width: 420px; }
.modal-delete-content { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-3); }
.modal-delete-header { background: linear-gradient(135deg, var(--c-danger) 0%, #a71d2a 100%); padding: 22px 24px 18px; }
.modal-delete-header .modal-title { font-size: var(--fs-md); }
.modal-delete-badge { background: rgba(255, 255, 255, .18); border-radius: var(--radius-md); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-delete-illustration { width: 76px; height: 76px; background: var(--c-danger-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--c-danger); }
.modal-delete-msg { font-size: var(--fs-sm); line-height: 1.5; }
.modal-delete-btn { border-radius: var(--radius-md); min-width: 110px; }
.banner-spacer { margin-bottom: 100px; }

/* Scrollbar das tabelas */
.table-responsive::-webkit-scrollbar { height: 12px; }
.table-responsive::-webkit-scrollbar-track { background: var(--n-100); border-radius: 4px; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 4px; }
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--n-500); }

/* Ícones de acção (ver/editar/eliminar) */
.action-icon { padding: 4px; border: none; background: none; cursor: pointer; opacity: .8; line-height: 1; transition: opacity .15s, background-color .15s; text-decoration: none; }
.action-icon:hover { opacity: 1; background-color: var(--n-100); text-decoration: none; }
.action-icon svg { width: 18px !important; height: 18px !important; display: block; }
.d-flex > form.d-inline { display: contents; }
.btn:not(.action-icon) svg { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; }

/* Responsividade global */
.nav-pills.profile-tab, .profile-pills-tab { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.nav-pills.profile-tab::-webkit-scrollbar, .profile-pills-tab::-webkit-scrollbar { display: none; }
.nav-pills.profile-tab .nav-link, .profile-pills-tab .nav-link { white-space: nowrap; }
.nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link { white-space: nowrap; }
.card-header.d-flex { flex-wrap: wrap; gap: .4rem; }
.breadcrumb { flex-wrap: wrap; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; }
.table-responsive { -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
  .row.g-0 > [class*="col-md-"].border-end { border-right: 0 !important; border-bottom: 1px solid var(--ds-border); }
}
@media (max-width: 576px) {
  input[type="file"].form-control { max-width: 100% !important; }
  .table > :not(caption) > * > * { padding: .4rem .35rem; font-size: .8rem; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .pagination .page-link { padding: .25rem .5rem; font-size: .8rem; }
  .acoes-bar .card-body { flex-wrap: wrap; }
  .acoes-bar .btn { font-size: .78rem; }
  #filtros-bar .form-label { font-size: var(--fs-xs); }
  #filtros-bar .form-control, #filtros-bar .form-select { font-size: .8rem; }
  .content-inner { padding-left: .5rem !important; padding-right: .5rem !important; }
  .card-header { flex-wrap: wrap; gap: .5rem; }
  .card-header .btn, .acoes-bar .btn { min-height: 40px; }
  .modal-dialog { margin: .5rem; }
  .form-control, .form-select { font-size: 16px; } /* evita zoom automático no iOS */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.3rem; }
  .btn-group { flex-wrap: wrap; }
  .dropdown-menu { max-width: calc(100vw - 1rem); }
  .info-row { flex-wrap: wrap; gap: .2rem; }
  .info-value { max-width: 100%; }
}
@media (max-width: 480px) {
  #toast-container { width: calc(100vw - 24px) !important; right: 12px !important; left: auto !important; max-width: none !important; }
  .iq-navbar .search-input { display: none !important; }
}
@media (min-width: 481px) and (max-width: 767px) { .iq-navbar .search-input { max-width: 150px; } }
@media (max-width: 360px) {
  .stat-card .card-body { padding: .6rem; }
  .stat-card .fs-4 { font-size: 1.1rem !important; }
}

/* Campo do chatbot / outros: foco visível */
.chat-input:focus-visible { outline: 3px solid var(--ds-focus); outline-offset: 1px; }
.maintenance-panel { background: transparent; height: 320px; }
.bg-ds { background: var(--ds-bg) !important; }

/* ---- Navbar e assistente (chatbot) ---- */
.flag-30 { height: 30px; min-width: 30px; width: 30px; }
.flag-20 { width: 20px; height: 20px; min-width: 20px; }
.object-cover { object-fit: cover; }
.chatbot-trigger { background: none; border: none; padding: 8px; cursor: pointer; position: relative; display: flex; align-items: center; color: var(--bs-body-color); }
.chatbot-badge { position: absolute; top: 4px; right: 2px; background: var(--brand-500); color: #fff; border-radius: var(--radius-md); font-size: var(--fs-xs); padding: 1px 4px; display: none; font-weight: var(--fw-bold); }

#chatbot-panel { position: fixed; top: 0; right: -440px; width: 420px; height: 100vh; background: var(--ds-surface); color: var(--ds-text); z-index: 10000; box-shadow: var(--shadow-3); display: flex; flex-direction: column; border-left: 1px solid var(--ds-border); visibility: hidden; transition: right .32s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .32s; }
#chatbot-panel.is-open { right: 0; visibility: visible; transition: right .32s cubic-bezier(.4, 0, .2, 1), visibility 0s; }
#chatbot-overlay { display: none; position: fixed; inset: 0; background: rgba(19, 15, 38, .35); z-index: 9999; }
#chatbot-overlay.is-open { display: block; }
@media (max-width: 480px) { #chatbot-panel { width: 100vw; right: -100vw; } }

.chatbot-header { background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); padding: 15px 18px; flex-shrink: 0; color: #fff; }
.chatbot-avatar { width: 38px; height: 38px; background: rgba(255, 255, 255, .2); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chatbot-title { font-weight: var(--fw-semibold); font-size: .95rem; }
.chatbot-status { color: rgba(255, 255, 255, .85); font-size: var(--fs-xs); display: flex; align-items: center; gap: 4px; }
.chatbot-status::before { content: ""; width: 6px; height: 6px; background: #a8f0a8; border-radius: 50%; display: inline-block; }
.chatbot-close { background: rgba(255, 255, 255, .18); border: none; color: #fff; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.chatbot-msgs { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: 10px; }
.chatbot-sugs { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--ds-border); flex-shrink: 0; }
.chatbot-sugs-title { font-size: var(--fs-xs); color: var(--ds-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.chatbot-footer { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--ds-border); flex-shrink: 0; background: var(--ds-bg); }
.chatbot-note { font-size: var(--fs-xs); color: var(--ds-muted); margin-top: 5px; text-align: center; }
.chat-input { flex: 1; border: 1.5px solid var(--ds-border); border-radius: var(--radius-lg); padding: 9px 13px; font-size: var(--fs-sm); resize: none; max-height: 100px; overflow-y: auto; line-height: 1.4; font-family: inherit; background: var(--ds-surface); color: var(--ds-text); transition: border-color .2s; }
.chat-input:focus { border-color: var(--brand-500); }
.chat-send { background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); border: none; color: #fff; border-radius: var(--radius-md); width: 42px; height: 42px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }
.chat-sug { background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--radius-pill); padding: 4px 10px; font-size: var(--fs-xs); cursor: pointer; color: var(--ds-muted); transition: background .15s, border-color .15s; }
.chat-sug:hover { background: var(--brand-100); border-color: var(--brand-500); color: var(--ds-primary); }
.chat-bubble-bot { background: var(--brand-50); border-radius: 0 14px 14px 14px; padding: 10px 14px; max-width: 88%; font-size: var(--fs-sm); line-height: 1.55; color: var(--ds-text); }
.chat-bubble-user { background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); color: #fff; border-radius: 14px 0 14px 14px; padding: 10px 14px; max-width: 85%; font-size: var(--fs-sm); line-height: 1.55; }
.chat-bubble-err { background: var(--c-danger-bg); border-left: 3px solid var(--c-danger); color: var(--c-danger); border-radius: 0 14px 14px 14px; padding: 10px 14px; max-width: 88%; font-size: var(--fs-sm); }
.chat-typing-dot { width: 7px; height: 7px; background: var(--brand-500); border-radius: 50%; animation: chatbounce .8s infinite; display: inline-block; }
.chat-typing-dot:nth-child(2) { animation-delay: .16s; }
.chat-typing-dot:nth-child(3) { animation-delay: .32s; }
@keyframes chatbounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }

/* Notificações (dropdown) */
.notif-dropdown { width: min(360px, calc(100vw - 16px)) !important; max-width: min(360px, calc(100vw - 16px)) !important; min-width: 0 !important; overflow: hidden !important; box-sizing: border-box !important; }
@media (max-width: 576px) {
  .notif-dropdown { position: fixed !important; top: 62px !important; right: 8px !important; left: auto !important; transform: none !important; width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; }
}
.notif-header { background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); }
.notif-title { font-size: .95rem; }
.notif-list { max-height: 360px; overflow-y: auto; overflow-x: hidden; }
.notif-item-inner { min-width: 0; overflow: hidden; }
.notif-icon { width: 34px; height: 34px; min-width: 34px; font-size: var(--fs-xs); }
.notif-icon.tone-success { background: var(--c-success-bg); color: var(--c-success); }
.notif-icon.tone-primary { background: var(--brand-100); color: var(--ds-primary); }
.notif-icon.tone-info { background: var(--c-info-bg); color: var(--c-info); }
.notif-icon.tone-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.notif-icon.tone-neutral { background: var(--n-100); color: var(--n-700); }
.notif-item-title { font-size: .83rem; min-width: 0; flex: 1; }
.notif-item-msg { font-size: .8rem; max-width: 100%; }
.notif-badge-count { font-size: var(--fs-xs); min-width: 18px; }
.notif-unread { background: var(--brand-50); }
.notif-footer-link { font-size: .8rem; white-space: nowrap; }

.header-banner { height: 215px; }
.upload-file-name { max-width: 160px; }
.upload-dropzone { border-color: var(--ds-border) !important; transition: border-color .2s, background-color .2s; }
.upload-dropzone.is-dragover, .upload-dropzone:focus-visible { border-color: var(--brand-500) !important; background-color: var(--brand-50); }
.upload-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }

/* ---- Cor da marca em componentes do tema -------------------------------- */
.btn-secondary {
  --bs-btn-bg: var(--n-100); --bs-btn-border-color: var(--n-300); --bs-btn-color: var(--n-900);
  --bs-btn-hover-bg: var(--n-200); --bs-btn-hover-border-color: var(--n-300); --bs-btn-hover-color: var(--n-900);
  --bs-btn-active-bg: var(--n-300); --bs-btn-active-border-color: var(--n-300); --bs-btn-active-color: var(--n-900);
}
.btn-outline-secondary {
  --bs-btn-color: var(--n-700); --bs-btn-border-color: var(--n-300);
  --bs-btn-hover-bg: var(--n-100); --bs-btn-hover-border-color: var(--n-500); --bs-btn-hover-color: var(--n-900);
  --bs-btn-active-bg: var(--n-200); --bs-btn-active-border-color: var(--n-500); --bs-btn-active-color: var(--n-900);
}
.btn-soft-primary { color: var(--ds-primary); background: var(--brand-100); border-color: transparent; }
.form-check-input:checked, .form-check-input[type=checkbox]:indeterminate { background-color: var(--brand-700); border-color: var(--brand-700); }
.form-check-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 .2rem rgba(57, 125, 136, .25); }
.link-primary { color: var(--ds-primary) !important; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand-700); --bs-nav-pills-link-active-color: #fff; }
.page-link { color: var(--ds-primary); }
.page-item.active .page-link { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.alert-primary { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-900); }
.dark .alert-primary { color: var(--ds-text); }
.progress-bar { background-color: var(--brand-700); }

/* ---- Opacidade de fundos: o Hope UI não define .bg-opacity-* → ficava sólido
        (ex.: iniciais "bg-primary bg-opacity-10 text-brand" ficavam invisíveis) --- */
.bg-opacity-10 { --bs-bg-opacity: .1; }
.bg-opacity-25 { --bs-bg-opacity: .25; }
.bg-opacity-50 { --bs-bg-opacity: .5; }
.bg-opacity-75 { --bs-bg-opacity: .75; }
.bg-opacity-100 { --bs-bg-opacity: 1; }
.bg-primary   { background-color: rgba(var(--bs-primary-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-secondary { background-color: rgba(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-success   { background-color: rgba(var(--bs-success-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-info      { background-color: rgba(var(--bs-info-rgb),      var(--bs-bg-opacity, 1)) !important; }
.bg-warning   { background-color: rgba(var(--bs-warning-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-danger    { background-color: rgba(var(--bs-danger-rgb),    var(--bs-bg-opacity, 1)) !important; }
/* Texto sobre fundos translúcidos legível em claro e escuro */
.bg-opacity-10.text-primary, .bg-opacity-10.text-brand { color: var(--ds-primary) !important; }

/* Iniciais/avatar com contraste garantido (listas de componentes, subcomponentes, actividades, perfis) */
.avatar-initials, .avatar-iniciais {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--brand-100) !important; color: var(--ds-primary) !important;
}
