﻿/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    position: relative;
    min-height: 100%;
    height: 100%;
    font-size: 14px;
}

body {
    height: 100%;
    margin-bottom: 60px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1351b4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-avatar {
    border: none;
    background: none;
    padding: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .header-actions .br-input {
        height: 28px;
    }

    .header-actions .br-button {
        height: 28px;
        padding: 4px 12px;
        font-size: 0.85rem;
    }

.header-top {
    position: relative;
}

.header-search {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

    .search-box i {
        color: #777;
    }

    .search-box input {
        border: none;
        outline: none;
        width: 100%;
        font-size: 12px;
    }

.br-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout {
    flex: 1;
    display: flex;
}

.main-content {
    flex: 1;
}

.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;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.layout {
    display: flex;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    transition: all 0.25s ease;
    min-height: calc(100vh - 120px);
}

.sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.sidebar-title {
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

    .sidebar-menu li {
        margin: 4px 0;
    }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    text-decoration: none;
    color: #333;
    font-weight: 300;
    border-left: 3px solid transparent;
    transition: all .2s ease;
}

    .sidebar-link i {
        width: 20px;
        text-align: center;
        font-size: 16px;
    }

    .sidebar-link:hover {
        background: #f3f6fb;
        border-left: 3px solid #1351b4;
        color: #1351b4;
    }

.sidebar-link-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    color: #666;
}

    .submenu-toggle:hover {
        color: #1351b4;
    }

.sidebar-submenu {
    display: none;
    padding: 8px 0;
    padding-left: 40px;
    margin-top: 4px;
    background: #f5f5f5;
    border-radius: 4px;
}

    .sidebar-submenu a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        font-size: 14px;
        color: #555;
        text-decoration: none;
    }

        .sidebar-submenu a i {
            width: 16px;
            font-size: 14px;
            text-align: center;
        }

        .sidebar-submenu a:hover {
            background: #e9eef6;
            color: #1351b4;
            border-radius: 4px;
        }

.has-submenu.open .sidebar-submenu {
    display: block;
}

.submenu-toggle i {
    transition: transform .25s ease;
}

.has-submenu.open .submenu-toggle i {
    transform: rotate(90deg);
}

.sidebar.collapsed {
    width: 70px;
}

    .sidebar.collapsed .sidebar-title,
    .sidebar.collapsed .sidebar-link span,
    .sidebar.collapsed #anoSelector,
    .sidebar.collapsed .submenu-toggle,
    .sidebar.collapsed .sidebar-submenu {
        display: none;
    }

    .sidebar.collapsed .sidebar-link {
        justify-content: center;
        position: relative;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-link:hover::after {
        content: attr(data-title);
        position: absolute;
        left: 70px;
        top: 50%;
        transform: translateY(-50%);
        background: #1351b4;
        color: white;
        padding: 6px 10px;
        border-radius: 4px;
        white-space: nowrap;
        font-size: 13px;
        z-index: 999;
    }

    .sidebar.collapsed .sidebar-link-group {
        justify-content: center;
    }

        .sidebar.collapsed .sidebar-link-group .sidebar-link {
            justify-content: center;
            width: 100%;
        }

.rh-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    padding: 30px 20px;
    background: linear-gradient(135deg,#1351b4,#0c326f);
    border-radius: 10px;
    border: 1px solid #d0def7;
    text-decoration: none !important;
    color: white;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

    .rh-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 28px rgba(0,0,0,0.25);
    }

.rh-icon {
    font-size: 28px;
    color: white;
    margin-bottom: 10px;
    transition: transform .2s ease;
}

.rh-card:hover .rh-icon {
    transform: scale(1.1);
}

.rh-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: white;
    line-height: 1.2;
}

.orgaos-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.orgao-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: white;
    transition: .2s;
    max-width: 900px;
}

    .orgao-card:hover {
        box-shadow: 0 8px 20px rgba(0,0,0,.08);
    }

.orgao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    cursor: pointer;
}

.orgao-titulo {
    display: flex;
    gap: 14px;
}

.orgao-icon {
    font-size: 22px;
    color: #1351b4;
}

.orgao-nome {
    font-weight: 600;
    font-size: 18px;
}

.orgao-endereco {
    font-size: 14px;
    color: #666;
}

.orgao-extra {
    display: flex;
    align-items: center;
    gap: 16px;
}

.orgao-servidores {
    background: #eef3fb;
    color: #1351b4;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.orgao-detalhe {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    padding: 0 18px;
}

.orgao-card.open .orgao-detalhe {
    max-height: 300px;
    padding-bottom: 18px;
}

.orgao-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.arrow {
    transition: .3s;
}

.orgao-card.open .arrow {
    transform: rotate(180deg);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap: 14px;
    margin-bottom: 25px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    color: white;
    transition: all .15s ease;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
}

.kpi-title {
    font-size: 13px;
    opacity: .9;
}

.kpi-value {
    font-size: 20px;
    font-weight: 600;
}

.kpi-card.clickable {
    cursor: pointer;
}

    .kpi-card.clickable:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    }

.kpi-blue {
    background: linear-gradient(135deg,#1351b4,#0c326f);
}

.kpi-green {
    background: linear-gradient(135deg,#168821,#0b5e13);
}

.kpi-purple {
    background: linear-gradient(135deg,#6f42c1,#4c2a91);
}

.kpi-orange {
    background: linear-gradient(135deg,#ff8c00,#d96a00);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr 1.3fr;
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.info-content {
    flex: 1;
}

.info-item {
    margin-bottom: 14px;
}

    .info-item strong {
        display: block;
        font-size: 12px;
        color: #555;
    }

    .info-item div {
        font-size: 14px;
        font-weight: 600;
    }

a.info-contact {
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #d4e3ff;
    border-radius: 6px;
    background: #f5f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1c7c54;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

    a.info-contact:hover {
        background: #eaf2ff;
        border-color: #b8d1ff;
        text-decoration: none !important;
    }

    .info-contact,
    .info-contact:hover,
    .info-contact:focus {
        text-decoration: none;
    }

        .info-contact span {
            text-decoration: none !important;
        }

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.custom-modal {
    background: white;
    width: 600px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.custom-modal-body {
    padding: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.card-header {
    background: #1351b4;
    color: white;
    font-weight: 600;
}

.filtros-card {
    background: #f5f6f8;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
}

    .filtros-card .card-body {
        padding: 10px 10px;
    }

    .filtros-card .form-label {
        font-size: 11px;
        color: #495057;
        margin-bottom: 2px;
    }

    .filtros-card .form-control {
        height: 26px;
        font-size: 11px;
        padding: 2px 4px;
        background: white;
    }

        .filtros-card .form-control:focus {
            box-shadow: 0 0 0 1px rgba(59,130,246,0.15);
        }

    .filtros-card .form-select {
        height: 26px;
        font-size: 11px;
        padding: 2px 4px;
        background: white;
    }

    .filtros-card .ts-wrapper {
        width: 100%;
    }

    .filtros-card .ts-wrapper {
        border: 1px solid #ced4da;
        border-radius: 4px;
        background: white;
    }

    .filtros-card .ts-control {
        border: none !important;
        box-shadow: none !important;
        padding: 2px 4px;
        min-height: 26px;
        display: flex;
        align-items: center;
    }

        .filtros-card .ts-control input {
            border: none !important;
            box-shadow: none !important;
            height: 20px;
            font-size: 11px;
        }

        .filtros-card .ts-control .item {
            background: #e8f1ff;
            color: #2f5ea8;
            padding: 1px 4px;
            font-size: 10px;
            border: none !important;
            border-radius: 3px;
        }

        .filtros-card .ts-control .remove {
            margin-left: 4px;
        }

    .filtros-card .ts-wrapper.focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 1px rgba(59,130,246,0.15);
    }

.ts-dropdown {
    z-index: 9999;
    font-size: 11px;
}

.btn-filtrar {
    background: white;
    border: 1px solid #c9d6ea;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

    .btn-filtrar:hover {
        background: #eef4ff;
        border-color: #3b82f6;
        color: #3b82f6;
    }

.tabela-servidores {
    font-size: 12px;
}

    .tabela-servidores thead th {
        font-size: 10px;
        font-weight: 600;
        padding: 6px 10px;
    }

    .tabela-servidores tbody td {
        font-size: 8px;
        padding: 4px 10px;
    }

    .tabela-servidores tbody tr {
        height: 18px;
    }

.tabela-scroll {
    max-height: 345px;
    width: 100%;
    overflow-y: auto;
    overflow-x:auto;
}

    .tabela-scroll thead th {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 2;
    }

.sortable {
    cursor: pointer;
    user-select: none;
}

    .sortable::after {
        content: " ⇅";
        font-size: 10px;
        color: #888;
    }

.ts-control {
    max-height: 38px;
    overflow-y: auto;
}

#tblFolha tr:hover {
    background: #eef3ff;
}

.valor {
    font-weight: 600;
    color: #1351b4;
}

.holerite-grid td,
.holerite-grid th {
    font-size: 11px;
}

.holerite-grid-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.holerite-grid tr.row-provento td {
    background: #eaf7ea !important;
}

.holerite-grid tr.row-desconto td {
    background: #fdeaea !important;
}

.holerite-grid tr.row-outros td {
    background: #eaf2ff !important;
}

.total-title {
    font-size: 12px;
    color: #666;
}

.total-value {
    font-size: 14px;
    font-weight: 600;
}

.total-provento {
    color: #1b7a2a;
}

.total-desconto {
    color: #b52a2a;
}

.total-liquido {
    color: #1f4fb8;
}

.legenda .badge {
    margin-right: 8px;
}

.legenda-provento {
    background: #2e7d32;
    color: #fff;
}

.legenda-desconto {
    background: #c62828;
    color: #fff;
}

.legenda-outros {
    background: #1e4db7;
    color: #fff;
}

#listaPagamentos .card-body {
    font-size: 13px;
}

#listaPagamentos .card-title {
    font-size: 14px;
    font-weight: 600;
}

#listaPagamentos p {
    font-size: 12px;
}

#listaPagamentos button {
    font-size: 11px;
    padding: 4px 6px;
}

.municipio-card-ui {
    border-radius: 12px;
    transition: all 0.25s ease;
    border: 1px solid #e5e5e5;
}

    .municipio-card-ui:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    }

.municipio-logo {
    height: 70px;
    object-fit: contain;
}

#buscaMunicipio {
    border-radius: 30px;
    padding-left: 20px;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid #1351b4;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: auto;
}

.loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: #444;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.mobile-menu-btn {
    display: none !important;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 5000;
}

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 4000;
        background: #1351b4;
        color: white;
        border: none;
        border-radius: 6px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    .sidebar {
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 240px;
        height: 100%;
        background: #fff;
        z-index: 3000;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

        .sidebar.open {
            pointer-events: auto;
            transform: translateX(0);
        }

        .sidebar.collapsed {
            transform: translateX(-100%) !important;
            width: 240px;
        }

    .layout {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.35);
        z-index: 2000;
        display: none;
    }

        .menu-overlay.active {
            display: block;
        }

        .sidebar.collapsed {
            width: 240px !important;
        }

            .sidebar.collapsed .sidebar-title,
            .sidebar.collapsed .sidebar-link span,
            .sidebar.collapsed .submenu-toggle,
            .sidebar.collapsed .sidebar-submenu {
                display: block !important;
            }

    .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .header-search {
        position: relative !important;
        left: auto !important;
        transform: none !important;
        width: 100%;
        margin-top: 8px;
    }

    .search-box {
        width: 100%;
    }

    #anoSelector {
        width: 100%;
        margin-top: 8px;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .dashboard-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .kpi-card {
        width: 100%;
        padding: 12px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .orgao-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .orgao-extra {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .filtros-card .form-control,
    .filtros-card .form-select {
        height: auto;
        font-size: 14px;
        padding: 6px;
    }

    .btn-filtrar {
        width: 100%;
        height: 42px;
    }

    .tabela-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabela-servidores {
        min-width: 650px;
        white-space: nowrap;
    }

    .custom-modal {
        width: 95%;
    }

    img, table, div {
        max-width: 100%;
        height: auto;
    }
}

@media (min-width: 769px) {

    .sidebar {
        transform: none !important;
        position: relative;
        pointer-events: auto;
    }
}