/* Unniflex UX — camada de refinamento visual, carregada depois do tema.
   Só usa as variáveis do tema (claro e escuro). Para desfazer: remover o <link> deste arquivo no portal. */
:root {
  --ux-ok: #16a34a;   --ux-ok-bg: rgba(34,197,94,.14);
  --ux-warn: #d97706; --ux-warn-bg: rgba(245,158,11,.15);
  --ux-err: #dc2626;  --ux-err-bg: rgba(239,68,68,.12);
  --ux-info: #2563eb; --ux-info-bg: rgba(59,130,246,.12);
  --ux-r-sm: 6px; --ux-r-md: 10px; --ux-r-lg: 14px;
  --ux-sombra: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.06);
}
:root[data-theme="dark"] {
  --ux-ok: #4ade80; --ux-warn: #fbbf24; --ux-err: #f87171; --ux-info: #60a5fa;
}

/* ── Ícones no lugar dos emojis ── */
i.ti.ux-ic-ok   { color: var(--ux-ok); }
i.ti.ux-ic-warn { color: var(--ux-warn); }
i.ti.ux-ic-err  { color: var(--ux-err); }
.ux-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 1px; margin-right: 1px; flex: none; }
.ux-dot-err  { background: #ef4444; }
.ux-dot-ok   { background: #22c55e; }
.ux-dot-warn { background: #f59e0b; }
.ux-dot-info { background: #3b82f6; }
.ux-dot-off  { background: #94a3b8; }
.ux-dot-dark { background: #475569; }
.ux-dot-orange { background: #f97316; }
button > i.ti, a > i.ti, label > i.ti { vertical-align: -2px; }
/* em botão colorido o ícone herda a cor do texto (senão verde sobre verde some) */
.btn-primary i.ti[class*="ux-ic-"], .btn-danger i.ti[class*="ux-ic-"] { color: inherit; }
.nav-link.active i.ti[class*="ux-ic-"], .page-btn.active i.ti[class*="ux-ic-"] { color: inherit; }

/* ── Foco visível para quem usa teclado ── */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible, summary:focus-visible,
.btn:focus-visible, .tab-btn:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--ux-r-sm);
}

/* ── Campos de seleção com o mesmo desenho em todos os navegadores ── */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  background-size: 15px !important;
  padding-right: 30px;
  text-overflow: ellipsis;
}
select:disabled, input:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }

/* ── Botões ── */
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn i.ti { font-size: 16px; }
.btn-sm i.ti { font-size: 14px; }

/* ── Tabelas ── */
th { white-space: nowrap; letter-spacing: .06em; }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ── Janelas ── */
.modal { box-shadow: 0 24px 64px rgba(15,23,42,.28); }
.modal-header h3 { display: flex; align-items: center; gap: 8px; letter-spacing: -.005em; }
.modal-close i.ti { font-size: 16px; }
.form-actions { padding-top: 4px; }

/* ── Estados vazio e carregando ── */
.empty-state { color: var(--text2); }
.empty-state i.ti { font-size: 34px; display: block; margin-bottom: 8px; opacity: .8; }
.ux-vazio { text-align: center; padding: 44px 20px; color: var(--text2); }
.ux-vazio i.ti { font-size: 34px; display: block; margin-bottom: 10px; opacity: .75; }
.ux-vazio b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.ux-carregando { display: inline-flex; align-items: center; gap: 8px; color: var(--text2); }
.ux-skel { border-radius: 8px; background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 37%, var(--bg3) 63%); background-size: 400% 100%; animation: ux-skel 1.3s ease infinite; min-height: 14px; }
@keyframes ux-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Caixa de confirmação / pergunta do portal ── */
.ux-dlg-ov { position: fixed; inset: 0; z-index: 100000; background: rgba(15,23,42,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: ux-fade .14s ease; }
.ux-dlg { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 420px;
  padding: 22px; box-shadow: 0 24px 64px rgba(15,23,42,.35); animation: ux-pop .18s cubic-bezier(.4,0,.2,1); }
.ux-dlg-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.ux-dlg-ic.info { background: rgba(16,185,129,.14); color: var(--accent); }
.ux-dlg-ic.perigo { background: var(--ux-err-bg); color: var(--ux-err); }
.ux-dlg h4 { font-size: 16px; font-weight: 700; color: var(--text1, var(--text)); margin: 0 0 6px; }
.ux-dlg p { font-size: 13.5px; line-height: 1.55; color: var(--text2); margin: 0; white-space: pre-line; word-break: break-word; }
.ux-dlg input { margin-top: 14px; width: 100%; }
.ux-dlg-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
@keyframes ux-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ux-pop { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ux-dlg, .ux-dlg-ov, .modal { animation: none !important; } .ux-skel { animation: none; } }

/* ── Menu lateral sem sublinhado e botões neutros legíveis no tema escuro ── */
.sidebar a, .sidebar a:hover, .nav-link, .nav-link:hover { text-decoration: none !important; }
:root[data-theme="dark"] .btn-ghost { background: var(--bg3); color: var(--text); border-color: var(--border); }
:root[data-theme="dark"] .btn-ghost:hover { background: var(--border); color: var(--text1, var(--text)); border-color: var(--border2); }

/* ── Botão .btn sem variante: aparência neutra consistente (antes ficava o cinza padrão do navegador) ── */
:where(.btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost)) { background-color: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
:where(.btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost)):hover { background-color: var(--bg3); }
