/* Framework G3 — ajustes visuais sobre o tema Argon */

/* ------------------------------------------------------------- temas de cor
   O tema comprado compila o primary fixo (laranja). Aqui a cor primária vira
   variável CSS, selecionável por usuário (cookie g3_theme). */
body { --g3-primary: #5e72e4; --g3-primary-2: #825ee4; --g3-primary-soft: rgba(94, 114, 228, .15); }
body[data-g3-theme="blue"]   { --g3-primary: #5e72e4; --g3-primary-2: #825ee4; --g3-primary-soft: rgba(94, 114, 228, .15); }
body[data-g3-theme="cyan"]   { --g3-primary: #11cdef; --g3-primary-2: #1171ef; --g3-primary-soft: rgba(17, 205, 239, .15); }
body[data-g3-theme="green"]  { --g3-primary: #2dce89; --g3-primary-2: #2dcecc; --g3-primary-soft: rgba(45, 206, 137, .15); }
body[data-g3-theme="dark"]   { --g3-primary: #344767; --g3-primary-2: #52688f; --g3-primary-soft: rgba(52, 71, 103, .15); }
body[data-g3-theme="red"]    { --g3-primary: #f5365c; --g3-primary-2: #f56036; --g3-primary-soft: rgba(245, 54, 92, .15); }
body[data-g3-theme="orange"] { --g3-primary: #fb6340; --g3-primary-2: #fbb140; --g3-primary-soft: rgba(251, 99, 64, .15); }

.bg-primary { background-color: var(--g3-primary) !important; }
.bg-gradient-primary { background-image: linear-gradient(310deg, var(--g3-primary) 0%, var(--g3-primary-2) 100%) !important; }
.text-primary { color: var(--g3-primary) !important; }
.btn-outline-primary { color: var(--g3-primary); border-color: var(--g3-primary); }
.btn-outline-primary:hover, .btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary {
    background-color: var(--g3-primary) !important;
    border-color: var(--g3-primary) !important;
    color: #fff !important;
    box-shadow: none;
}
.btn-primary { background-color: var(--g3-primary); border-color: var(--g3-primary); }
.page-item.active .page-link { background-color: var(--g3-primary); border-color: var(--g3-primary); }
.form-check-input:checked {
    background-color: var(--g3-primary);
    border-color: var(--g3-primary);
    background-image: linear-gradient(310deg, var(--g3-primary) 0%, var(--g3-primary-2) 100%) !important;
}
.form-control:focus { border-color: var(--g3-primary); }
.form-switch .form-check-input:checked { border-color: var(--g3-primary); background-color: var(--g3-primary); }
.badge.bg-gradient-primary { background-image: linear-gradient(310deg, var(--g3-primary) 0%, var(--g3-primary-2) 100%) !important; }
.nav-pills .nav-link.active { color: var(--g3-primary); }
.g3-theme-dot {
    width: 1.15rem; height: 1.15rem; border-radius: 50%; display: inline-block;
    cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

.g3-field .form-label { margin-bottom: .25rem; font-weight: 600; }

/* Choices.js alinhado ao Argon */
.choices { margin-bottom: 0; width: 100%; }
.input-group > .choices { flex: 1 1 auto; min-width: 0; }
.choices__list--dropdown, .choices__list[aria-expanded] {
    min-width: 100%;
    width: max-content;
    max-width: 420px;
    background: #fff !important;
    border: 1px solid #d2d6da !important;
    box-shadow: 0 8px 26px -4px rgba(20, 20, 20, .15) !important;
    z-index: 1060;
}
.choices__list--dropdown .choices__list { background: #fff !important; }
.choices__list--dropdown .choices__input--cloned,
.choices__list--dropdown input.choices__input {
    background: #fff !important;
    border-bottom: 1px solid #e9ecef !important;
    color: #344767 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: .5rem .75rem !important;
}
.choices__list--dropdown .choices__item { white-space: nowrap; color: #344767 !important; opacity: 1 !important; }
.choices__list--dropdown .choices__item--selectable.is-highlighted { background: #f6f9fc !important; color: #344767 !important; }
.choices__list--dropdown .choices__input { color: #344767; background: #fff; }

/* neutraliza o dropdown "3D" do tema (perspective/translateZ quebra a pintura) */
.choices .choices__list--dropdown,
.choices .choices__list--dropdown.is-active {
    transform: none !important;
    top: 100% !important;
    margin-top: 2px !important;
    padding: .35rem 0 !important;
    transition: none !important;
    isolation: isolate;
}
.choices .choices__list--dropdown.is-active { opacity: 1 !important; }
.choices .choices__list--dropdown:not(.is-active) { opacity: 0 !important; }
.choices .choices__list--dropdown:before { display: none !important; }
.choices .choices__list--dropdown .choices__item--selectable { padding-right: 1rem !important; }
.choices .choices__list--dropdown .choices__item--selectable:after { display: none !important; }
.g3-filters .choices__inner { min-height: calc(1.5em + 1.05rem + 2px); padding-top: .3rem; }
.choices__inner {
    background: #fff;
    border: 1px solid #d2d6da;
    border-radius: .5rem;
    min-height: calc(1.5em + 1.25rem + 2px);
    padding: .4rem .75rem .25rem;
    font-size: .875rem;
}
.is-focused .choices__inner, .is-open .choices__inner {
    border-color: #5e72e4;
    box-shadow: 0 0 0 2px rgba(94, 114, 228, .15);
}
.choices__list--dropdown, .choices__list[aria-expanded] { border-radius: .5rem; z-index: 1051; }
.choices__list--dropdown .choices__item--selectable.is-highlighted { background: #f6f9fc; }
.choices[data-type*=select-one]::after { border-color: #8392ab transparent transparent; }
.choices__list--multiple .choices__item {
    background: #5e72e4; border-color: #5e72e4; border-radius: .35rem; font-size: .75rem;
}
.choices__input { font-size: .875rem; margin-bottom: 0; }

/* flatpickr acima de modais */
.flatpickr-calendar { z-index: 1060 !important; }

/* chips do select múltiplo: não quebrar no meio da palavra, tamanho compacto */
.choices__list--multiple .choices__item {
    white-space: nowrap;
    word-break: normal;
    font-size: .72rem;
    padding: 2px 8px;
    margin-bottom: 2px;
}

/* atalhos de período no rodapé do range picker */
.g3-range-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid #e9ecef;
}
.g3-range-shortcuts button {
    border: 1px solid #d2d6da;
    background: #fff;
    border-radius: .4rem;
    padding: 2px 8px;
    font-size: .72rem;
    color: #344767;
    cursor: pointer;
}
.g3-range-shortcuts button:hover {
    background: var(--g3-primary);
    border-color: var(--g3-primary);
    color: #fff;
}

/* restaura as bordas dos inputs em input-group — o tema as zera com
   "border-right:#fff!important" num seletor de alta especificidade; os :not()
   abaixo só existem para empatar a especificidade e vencer pela ordem. */
.input-group { position: relative; }
.input-group > .form-control:not(.g3-n1):not(.g3-n2):not(.g3-n3):not(.g3-n4):not(.g3-n5) {
    border-top: 1px solid #d2d6da !important;
    border-bottom: 1px solid #d2d6da !important;
    border-right: 1px solid #d2d6da !important;
    border-left: 1px solid #d2d6da !important;
}
.input-group > .form-control:not(:first-child):not(.g3-n1):not(.g3-n2):not(.g3-n3):not(.g3-n4) {
    border-left: 0 !important;
}
.input-group > .form-control:focus:not(.g3-n1):not(.g3-n2):not(.g3-n3):not(.g3-n4):not(.g3-n5) {
    border-color: var(--g3-primary) !important;
}
.input-group > .form-control:focus:not(:first-child):not(.g3-n1):not(.g3-n2):not(.g3-n3):not(.g3-n4) {
    border-left: 0 !important;
}
.input-group.focused .input-group-text { border-color: var(--g3-primary) !important; }

/* sugestões de horário (substitui o datalist nativo): altura limitada + scroll */
.g3-time-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #d2d6da;
    border-radius: .5rem;
    box-shadow: 0 8px 26px -4px rgba(20, 20, 20, .15);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}
.g3-time-suggest .g3-time-item {
    padding: .35rem .75rem;
    font-size: .875rem;
    color: #344767;
    cursor: pointer;
}
.g3-time-suggest .g3-time-item:hover,
.g3-time-suggest .g3-time-item.is-active { background: #f6f9fc; }

/* Tabela: célula de ações compacta */
.table td .btn { line-height: 1; }
.table td form { display: inline; }

/* Validação client-side: destaque também no wrapper do Choices */
.choices__inner.is-invalid { border-color: #fd5c70 !important; }

/* Quill */
.g3-wysiwyg .ql-editor { min-height: 8rem; }

/* Campos calculados */
.g3-calculated { color: #67748e; }

/* Vue */
[v-cloak] { display: none; }

/* Busca global */
#g3-global-search + .dropdown-menu { top: 100%; left: 0; }

/* Toggler no cabeçalho da sidebar: some quando minimizada (não cabe nos 6rem);
   reaparece no hover, quando a sidebar expande */
.sidenav-header .sidenav-toggler { transition: opacity .3s ease; }
.g-sidenav-hidden .sidenav:not(:hover) .sidenav-header .sidenav-toggler { opacity: 0; }

/* Impressão */
@media print {
    .sidenav, .navbar-main, .g3-filters, .card-header .btn, .footer { display: none !important; }
    .main-content { margin-left: 0 !important; }
}
