/* ============================================================
   site5.css - estilos do shell "V2" (Bootstrap 5)
   Usado apenas pelas views já migradas (_LayoutAdminV2, _LayoutLogin,
   _Layout). Não afeta o shell antigo (site.css / _LayoutAdmin).
   ============================================================ */

:root {
    --wd-sidebar-width: 260px;
    --wd-sidebar-bg: #1e2a38;
    --wd-sidebar-bg-active: #2a3b4f;
    --wd-sidebar-text: #c3ccd9;
    --wd-sidebar-text-active: #ffffff;
    --wd-accent: #4e73df;
    --wd-content-bg: #f4f6f9;
}

body {
    background-color: var(--wd-content-bg);
}

/* ---------- Layout geral ---------- */

#wrapperV2 {
    min-height: 100vh;
}

.main-v2 {
    min-width: 0;
}

.content-v2 {
    padding: 1.5rem;
}

/* ---------- Sidebar ---------- */

.sidebar-v2 {
    width: var(--wd-sidebar-width);
    /* !important necessário: Bootstrap 5 força background-color:transparent!important
       em .offcanvas-lg a partir de 992px (quando ele vira sidebar estática), o que
       apagava o fundo escuro da sidebar em telas largas. */
    background-color: var(--wd-sidebar-bg) !important;
    color: var(--wd-sidebar-text);
    /* O menu não usa .offcanvas-body (só o Bootstrap dá overflow-y:auto a ela),
       então sem isso aqui o conteúdo do offcanvas no mobile fica sem rolagem. */
    overflow-y: auto;
}

@media (min-width: 992px) {
    .sidebar-v2 {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-shrink: 0;
    }
}

.sidebar-v2 .sidebar-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
    display: block;
}

.sidebar-v2 .sidebar-brand:hover {
    color: #fff;
}

.sidebar-v2 .nav-link {
    color: var(--wd-sidebar-text);
    padding: .6rem 1.25rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sidebar-v2 .nav-link i {
    width: 1.1em;
    text-align: center;
    opacity: .85;
}

.sidebar-v2 .nav-link:hover,
.sidebar-v2 .nav-link.active {
    background-color: var(--wd-sidebar-bg-active);
    color: var(--wd-sidebar-text-active);
}

.sidebar-v2 .nav-group-toggle {
    cursor: pointer;
    justify-content: space-between;
}

.sidebar-v2 .nav-group-toggle .chevron {
    transition: transform .15s ease;
    font-size: .75em;
}

.sidebar-v2 .nav-group-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
}

.sidebar-v2 .nav-submenu {
    background-color: rgba(0, 0, 0, .15);
}

.sidebar-v2 .nav-submenu .nav-link {
    padding-left: 2.6rem;
    font-size: .92rem;
}

.sidebar-v2 .sidebar-section-title {
    color: rgba(255, 255, 255, .35);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1rem 1.25rem .35rem;
}

/* ---------- Topbar ---------- */

.topbar-v2 {
    background-color: #fff;
    padding: .6rem 1rem;
}

.topbar-v2 .sidebar-toggle-btn {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: #495057;
}

/* ---------- Overlay de carregamento (herdado do shell antigo) ---------- */

.spinner-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
}

.fa-spinner {
    font-size: 40px;
    color: var(--wd-accent);
}

/* ---------- Ajustes herdados do _LayoutAdmin antigo ---------- */

ul.ui-autocomplete {
    z-index: 1100;
}

.table-responsive {
    padding-bottom: 115px;
}

/* ---------- Barra de pesquisa + cadastrar (listagens) ----------
   Input + botões sempre na mesma linha, alinhados. */

.search-create-row {
    flex-wrap: nowrap;
}

.search-create-row .search-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- Toques modernos gerais ---------- */

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    border-radius: .6rem;
}

.btn {
    border-radius: .45rem;
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom-width: 1px;
}

/* ---------- Paginação (PagedList.Mvc) ----------
   O PagedList.Mvc gera markup no padrão Bootstrap 3 (<li><a>, sem
   page-item/page-link), que o Bootstrap 5 não estiliza mais sozinho.
   Estas regras miram as classes reais que a biblioteca emite. */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    list-style: none;
    padding-left: 0;
    margin: .5rem 0;
}

.pagination li {
    display: block;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .6rem;
    border-radius: .5rem;
    border: 1px solid #e3e6ec;
    background-color: #fff;
    color: #3d4859;
    font-size: .9rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}

.pagination li a:hover {
    background-color: var(--wd-content-bg);
    border-color: var(--wd-accent);
    color: var(--wd-accent);
}

.pagination li a:active {
    transform: scale(.95);
}

.pagination li.active a,
.pagination li.active span {
    background-color: var(--wd-accent);
    border-color: var(--wd-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(78, 115, 223, .35);
}

.pagination li.disabled a,
.pagination li.disabled span,
.pagination li.PagedList-ellipses span {
    color: #b7bdc9;
    background-color: #f7f8fa;
    border-color: #edeff2;
    cursor: default;
}

.pagination li.PagedList-skipToPrevious a,
.pagination li.PagedList-skipToNext a {
    font-weight: 700;
    color: var(--wd-accent);
    border-color: #e3e6ec;
}

.pagination li.PagedList-skipToPrevious a:hover,
.pagination li.PagedList-skipToNext a:hover {
    background-color: var(--wd-accent);
    border-color: var(--wd-accent);
    color: #fff;
}

/* ---------- Menu de ações mobile (dropdown nas listagens) ----------
   Os links dentro do <li> reaproveitam as classes .btn dos botões de
   desktop, que não esticam para ocupar a largura do menu. Força o
   comportamento de item de dropdown (bloco, largura total). */

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu li > a {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 0;
    background-color: transparent;
    color: #3d4859;
    padding: .5rem 1rem;
    font-size: .9rem;
}

.dropdown-menu li > a:hover {
    background-color: var(--wd-content-bg);
    color: var(--wd-accent);
}

.dropdown-menu li > a.btn-danger {
    color: #e74a3b;
}

.dropdown-menu li > a.btn-danger:hover {
    background-color: #fdecea;
    color: #c0392b;
}

.dropdown-menu li > a.disabled,
.dropdown-menu li > a[disabled] {
    color: #b7bdc9;
    pointer-events: none;
}
