/* ============================================================
   theme-custom.css — Cor primaria da marca (Coplan)
   Base: #c7a963 (dourado — mesmo tom ja usado como destaque do
   skin "matrix" no sidebar). Sobrescreve --theme-primary e os
   tons derivados (rgb, text-emphasis, bg-subtle, border-subtle)
   usados em ~300 regras do tema Paces (badges, links, bordas,
   spinners, paginacao, form-checks, etc.).
   Deve ser carregado DEPOIS de app.min.css.
   ============================================================ */

/*
 * O skin "matrix" (usado como padrao do sistema) redefine --theme-primary
 * e derivados dentro do seletor "html[data-skin=matrix]", que tem mais
 * especificidade que ":root". Por isso o override precisa mirar o MESMO
 * seletor (nao ":root") para realmente vencer a cascata.
 */
:root,
[data-bs-theme=light],
[data-bs-theme=dark],
html[data-skin=matrix] {
    --theme-primary: #c7a963;
    --theme-primary-rgb: 199, 169, 99;
    --theme-primary-text-emphasis: #aa9054;
    --theme-primary-bg-subtle: rgba(199, 169, 99, 0.15);
    --theme-primary-border-subtle: rgba(199, 169, 99, 0.3);
    --theme-chart-primary: #c7a963;
    --theme-chart-primary-rgb: 199, 169, 99;
}

/* .btn-primary e .btn-outline-primary guardam seus proprios tons
   (hover/active/focus) como variaveis locais fixas no build do
   tema, entao precisam ser recalculadas manualmente aqui.
   Texto escuro nos botoes preenchidos: dourado e uma cor clara,
   texto branco teria contraste ruim. */
.btn-primary {
    --theme-btn-color: #1e190f;
    --theme-btn-bg: #c7a963;
    --theme-btn-border-color: #c7a963;
    --theme-btn-hover-color: #1e190f;
    --theme-btn-hover-bg: #b59a5a;
    --theme-btn-hover-border-color: #ab9155;
    --theme-btn-focus-shadow-rgb: 207, 182, 122;
    --theme-btn-active-color: #1e190f;
    --theme-btn-active-bg: #ab9155;
    --theme-btn-active-border-color: #a08a50;
    --theme-btn-disabled-color: #1e190f;
    --theme-btn-disabled-bg: #c7a963;
    --theme-btn-disabled-border-color: #c7a963;
}

.btn-outline-primary {
    --theme-btn-color: #9f874f;
    --theme-btn-border-color: #c7a963;
    --theme-btn-hover-color: #1e190f;
    --theme-btn-hover-bg: #c7a963;
    --theme-btn-hover-border-color: #c7a963;
    --theme-btn-focus-shadow-rgb: 207, 182, 122;
    --theme-btn-active-color: #1e190f;
    --theme-btn-active-bg: #c7a963;
    --theme-btn-active-border-color: #c7a963;
    --theme-btn-disabled-color: #c7a963;
}

.btn-soft-primary,
.btn-ghost-primary {
    --theme-btn-hover-color: #1e190f;
    --theme-btn-active-color: #1e190f;
}

/* ============================================================
   Dark mode — remove o viés azulado do tema padrao (Paces usa
   uma escala "navy" em quase todo superficie/texto do dark mode:
   body/card/border com B > R, texto acinzentado com tom frio,
   sidenav e topbar tambem "navy"). Aqui a escala e trocada por
   cinzas neutros (R=G=B) / preto, mantendo apenas as cores
   semanticas (success/info/warning/danger) e a marca (dourado)
   como estavam.
   ============================================================ */
[data-bs-theme=dark][data-skin=matrix] {
    --theme-body-color: #c7c7c7;
    --theme-body-color-rgb: 199, 199, 199;
    --theme-body-bg: #121212;
    --theme-body-bg-rgb: 18, 18, 18;
    --theme-emphasis-color: #000000;
    --theme-emphasis-color-rgb: 0, 0, 0;
    --theme-secondary-color: #9a9a9a;
    --theme-secondary-color-rgb: 154, 154, 154;
    --theme-secondary-bg: #1a1a1a;
    --theme-secondary-bg-rgb: 26, 26, 26;
    --theme-tertiary-color: #c7c7c7;
    --theme-tertiary-color-rgb: 199, 199, 199;
    --theme-tertiary-bg: #242424;
    --theme-tertiary-bg-rgb: 36, 36, 36;
    --theme-heading-color: #e0e0e0;
    --theme-link-color: var(--theme-primary);
    --theme-link-hover-color: var(--theme-primary-text-emphasis);
    --theme-link-color-rgb: var(--theme-primary-rgb);
    --theme-link-hover-color-rgb: var(--theme-primary-rgb);
    --theme-border-color: #2e2e2e;
    --theme-border-color-translucent: #6b6b6b;
    --theme-theme-card-border-color: #2e2e2e;
    --theme-box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5);
    --theme-chart-gray: #3a3a3a;
    --theme-chart-gray-rgb: 58, 58, 58;
    --theme-chart-border-color: #262626;
}

[data-bs-theme=dark] .text-dark {
    color: #e8e8e8 !important;
}

/* Sidenav e topbar do dark mode devem usar as MESMAS cores do
   sidenav "escuro" do tema light-mode (nao a escala navy propria
   do dark mode). Repete a especificidade original das regras do
   Paces para vencer a cascata. */
html[data-skin=matrix][data-bs-theme=dark][data-menu-color=dark],
html[data-skin=matrix][data-bs-theme=dark][data-menu-color=gray],
html[data-skin=matrix][data-bs-theme=dark][data-menu-color=light] {
    --theme-sidenav-bg: #0d0d0d;
    --theme-sidenav-border-color: #1f1f1f;
    --theme-sidenav-item-color: #7a7a7a;
    --theme-sidenav-item-hover-color: #c4c4c4;
    --theme-sidenav-item-hover-bg: #1a1a1a;
    --theme-sidenav-item-active-color: #c7a963;
    --theme-sidenav-item-active-bg: #201d16;
}

html[data-skin=matrix][data-bs-theme=dark][data-topbar-color=dark],
html[data-skin=matrix][data-bs-theme=dark][data-topbar-color=gray],
html[data-skin=matrix][data-bs-theme=dark][data-topbar-color=light] {
    --theme-topbar-bg: #181818;
    --theme-topbar-item-color: #adb5bf;
    --theme-topbar-item-hover-color: #c7a963;
    --theme-topbar-search-bg: #222222;
    --theme-topbar-search-border: #222222;
}

[data-bs-theme=dark] {
    --theme-light: #2f2f30;
    --theme-light-rgb: 47, 47, 48;
    --theme-dark: #5b5b5c;
    --theme-dark-rgb: 91, 91, 92;
}
[data-bs-theme=dark] .selectize-input, .selectize-control.single .selectize-input.input-active {
    background: #1a1a1a;
}	
[data-bs-theme=dark] .selectize-input {
    border: 1px solid #2e2e2e;
}	
	
[data-bs-theme=dark] .selectize-input.focus {
    border-color: #fbd781;
	box-shadow: none;
}	
[data-bs-theme=dark] .selectize-control.multi .selectize-input>div {
    background: #2d2d2d;
    color: #9a9a9a;
}	
[data-bs-theme=dark] .selectize-control.plugin-remove_button .item .remove {
	border-left: 1px solid #393939;
}	
[data-bs-theme=dark] .selectize-dropdown, [data-bs-theme=dark] .selectize-dropdown.form-control{
	background: #1a1a1a;
}
	
[data-bs-theme=dark] .selectize-dropdown, .selectize-input, [data-bs-theme=dark] .selectize-input input {
    color: #9a9a9a;
}	
[data-bs-theme=dark] .selectize-dropdown .active:not(.selected), [data-bs-theme=dark] select option:hover {
    background: #99C8FF;
    background-color: #99C8FF;
    color: #1A1A1A;
}

.app-search {
	position: relative
}

[data-table-search]{
	padding-left: 30px;
}

.app-search-icon{
	padding: 0 10px;
}

[data-bs-theme=dark] .auth-brand .logo-dark{
	display: none;
}
[data-bs-theme=dark] .auth-brand .logo-light{
	display: inline;
}
[data-bs-theme=light] .auth-brand .logo-dark{
	display: inline;
}
[data-bs-theme=light] .auth-brand .logo-light{
	display: none;
}