/* Custom styles for Consignado Backoffice */
/* Fonte e padrão alinhados a Consignado.Backoffice.Fundacao (cores mantidas do Backoffice) */
:root {
    --bs-body-font-family: "Source Sans 3", "Helvetica Neue", Roboto, Arial, sans-serif;
    --bs-body-font-size: 0.875rem;
}

.wrapper {
    width: 100%;
    will-change: auto;
    transition: padding 0.15s;
}

html:not([dir=rtl]) .wrapper {
    padding-left: var(--cui-sidebar-occupy-start, 0);
}

*[dir=rtl] .wrapper {
    padding-right: var(--cui-sidebar-occupy-start, 0);
}

@media (prefers-reduced-motion: reduce) {
    .wrapper {
        transition: none;
    }
}

/* Card styling improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.nav-item {
    min-width: 100%
}

/* Exception for header nav - items must not take full width (mesmo padrão Fundacao) */
.header-nav .nav-item {
    min-width: auto;
}

/* Exception for nav-tabs - tabs should be side by side */
.nav-tabs .nav-item {
    min-width: auto;
}

.nav-group {
    min-width: 100%
}

/* Fix for sidebar scroll when content exceeds viewport height */
#sidebar {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

#sidebar .sidebar-brand {
    flex-shrink: 0 !important;
}

#sidebar .sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    max-height: none !important;
}

/* Ensure SimpleBar wrapper has correct height */
#sidebar .sidebar-nav[data-simplebar] .simplebar-wrapper {
    height: 100% !important;
    max-height: 100% !important;
}

#sidebar .sidebar-nav[data-simplebar] .simplebar-content-wrapper {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
}

#sidebar .sidebar-nav[data-simplebar] .simplebar-content {
    min-height: 100%;
}

/* Fix for nav-group-toggle when sidebar has scroll */
.sidebar-nav .nav-group-toggle {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    cursor: pointer;
    user-select: none;
}

.sidebar-nav .nav-group-items {
    position: relative;
    z-index: 0;
}

/* Form styling */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Numeric fields - Right-to-left text direction (digitação da direita para esquerda) */
input[type="number"],
input.decimal,
input.decimalZeroAllowed,
input.decimalInvariant,
input.decimalInvariant5,
input.percent {
    text-align: right !important;
    direction: ltr; /* Keep LTR for numeric input, but align right */
}

/* Ensure maskMoney fields also align right */
.form-control.decimal,
.form-control.decimalZeroAllowed,
.form-control.decimalInvariant,
.form-control.decimalInvariant5,
.form-control.percent {
    text-align: right !important;
}

/* Menus de contexto das grids: fonte menor (mesmo padrão Fundacao) */
.table .dropdown-menu,
.table-responsive .dropdown-menu {
    font-size: 0.75rem;
}
.table .dropdown-menu .dropdown-item,
.table-responsive .dropdown-menu .dropdown-item {
    font-size: inherit;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}
