body {
    background-color: #f4f6f9;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    color: #1f2937;
    min-height: 100vh;
}

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --color-primary: #0d6efd;
    --color-secondary: #6c757d;
    --color-surface: #ffffff;
    --color-muted: #6b7280;
}

:root.theme-dark {
    --color-primary: #38bdf8;
    --color-secondary: #94a3b8;
    --color-surface: #111827;
    --color-muted: #9ca3af;
}

:root.theme-dark body {
    background-color: #0b1120;
    color: #e2e8f0;
}

:root.theme-dark .content-wrapper {
    background: #050b16;
    color: #e2e8f0;
}

.sigop-update-overlay {
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 0.5rem;
    bottom: 1rem;
    color: #fff;
    display: none;
    justify-content: center;
    left: 1rem;
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 5;
}

.sigop-update-overlay.is-active {
    display: flex;
}

.sigop-update-modal {
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    animation: sigopUpdatePop 0.35s ease;
}

.sigop-update-eyebrow {
    color: #64748b;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sigop-update-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sigop-update-pill {
    background: #f1f5f9;
    border-radius: 999px;
    color: #0f172a;
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    align-items: center;
    font-weight: 600;
}

.sigop-update-pill .label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.sigop-update-pill.is-primary {
    background: rgba(13, 110, 253, 0.12);
    color: #0b5ed7;
}

.sigop-update-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
}

.sigop-update-card-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.6rem;
}

.sigop-update-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #334155;
}

.sigop-update-list li {
    margin-bottom: 0.4rem;
}

.sigop-update-version-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(13, 110, 253, 0.4);
    font-weight: 600;
}

.sigop-update-version-link:hover {
    color: #0b5ed7;
}

.sigop-update-once {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.sigop-update-once-content {
    min-width: 0;
}

.sigop-update-once-label {
    display: inline-block;
    position: relative;
    padding-left: 30px;
    margin: 0;
    cursor: pointer;
}

.sigop-update-once-title {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.sigop-update-once small {
    display: block;
    margin-top: 0.15rem;
    color: #6b7280;
    font-weight: 400;
}

.sigop-update-once .form-check-input {
    position: absolute;
    left: 0;
    top: 0.05rem;
    margin: 0;
    width: 20px;
    height: 20px;
}

.sigop-versions-list {
    display: grid;
    gap: 1rem;
}

.sigop-version-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    background: #fff;
}

.sigop-version-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.sigop-version-items {
    margin: 0;
    padding-left: 1.2rem;
    color: #334155;
}

.sigop-update-cta {
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.25);
}

.field-locked {
    background-color: #eef5ff;
    border-color: #9ec5ff;
    color: #1c3d7a;
}

@keyframes sigopUpdatePop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sigop-swal-popup {
    border-radius: 18px;
    padding: 1.5rem;
}

.sigop-swal-title {
    font-weight: 600;
}

.sigop-swal-confirm {
    border-radius: 999px !important;
    padding: 0.55rem 1.5rem;
}

.theme-dark .main-header.navbar,
.theme-dark .main-footer {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .main-header .nav-link,
.theme-dark .main-header .btn {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.4);
}

.theme-dark .main-header .btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.theme-dark .card,
.theme-dark .modal-content,
.theme-dark .dropdown-menu {
    background: #111827;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.8);
}

.theme-dark .card-title,
.theme-dark .crud-title {
    color: #f8fafc;
}

.theme-dark .table {
    color: #e2e8f0;
}

.theme-dark .table thead th {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.25);
}

.theme-dark .table tbody tr {
    border-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark textarea {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.35);
    color: #f8fafc;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus,
.theme-dark textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
}

.theme-dark .btn-light {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.25);
}

.theme-dark .btn-light:hover {
    background: #334155;
}

.theme-dark .alert-info {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
    color: #bae6fd;
}


.theme-dark .datatable-container table {
    background: #111827;
}

.theme-dark .list-group-item {
    background: #1f2937;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
}

.pagination {
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.pagination .page-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.85rem;
}

.pagination .page-item.active .page-link {
    font-weight: 600;
}

.pagination .page-link {
    border-radius: 8px;
}

.theme-dark .pagination .page-link {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.25);
}

.theme-dark .pagination .page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #0b1120;
}

.theme-dark .pagination .page-item.disabled .page-link {
    color: #94a3b8;
    background: #0b1220;
    border-color: rgba(148, 163, 184, 0.2);
}

[data-procedimento-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-procedimento-secretaria-list],
[data-procedimento-tipoobjeto-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-procedimento-list] .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
}

[data-procedimento-secretaria-list] .dropdown-item,
[data-procedimento-tipoobjeto-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-procedimento-list] [data-procedimento-search] {
    width: 100%;
}

[data-procedimento-secretaria-label],
[data-procedimento-tipoobjeto-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

.legend-filter {
    border: 0;
    background: transparent;
    padding: 0.1rem 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.legend-filter.is-active {
    background: rgba(13, 110, 253, 0.12);
    border-radius: 999px;
}

.theme-dark .notification-badge {
    border: 1px solid #0f172a;
}

.crud-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.card-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.module-highlight {
    border: 1px solid #0d6efd20 !important;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.08);
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: calc(3.2rem + env(safe-area-inset-top, 0));
    padding-bottom: 4rem; /* reserva espaço para footer fixo */
    position: relative;
}

.main-header.navbar {
    min-height: 3.5rem;
    padding-top: calc(0.35rem + env(safe-area-inset-top, 0));
    padding-bottom: 0.35rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.main-header .nav-link {
    color: #1f2937;
    font-weight: 600;
}

.main-header .nav-link:hover {
    color: var(--color-primary);
}

.content-wrapper {
    background: #f4f6f9;
    margin-left: var(--sidebar-width);
    transition: margin-left .2s ease-in-out;
    padding: 0.15rem 0 0.8rem;
    flex: 1 0 auto;
    box-sizing: border-box;
}

.main-footer {
    background: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1.25rem;
    z-index: 1030;
}

.main-sidebar {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    width: var(--sidebar-width);
    transition: width .2s ease-in-out, box-shadow .2s ease-in-out;
    overflow-x: hidden;
}

.main-sidebar .brand-link {
    background: rgba(255, 255, 255, 0.03);
    color: #e5e7eb;
    font-weight: 700;
    letter-spacing: .5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-sidebar .nav-sidebar > .nav-item > .nav-link {
    color: #c7d2fe !important;
    margin: 2px 6px;
    border-radius: 10px;
    padding: 9px 14px;
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 10px;
    align-items: center;
    font-weight: 600;
    transition: background .15s ease, transform .15s ease;
}

.main-sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon {
    color: inherit !important;
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.main-sidebar .nav-sidebar > .nav-item > .nav-link:hover,
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
    transform: translateX(2px);
}

.main-sidebar .nav-header {
    color: #93a4c3;
    font-size: 0.8rem;
    letter-spacing: .1em;
    padding: 12px 16px 8px;
    text-transform: uppercase;
}

body.sidebar-collapse .main-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link {
    justify-content: center;
    padding: 10px 0;
}

body.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link p,
body.sidebar-collapse .main-sidebar .nav-header {
    display: none;
}

body.sidebar-collapse:not(.sidebar-open) .content-wrapper,
body.sidebar-collapse:not(.sidebar-open) .main-footer {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
    .main-sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 1050;
    }
    body.sidebar-open .main-sidebar {
        transform: translateX(0);
        box-shadow: 6px 0 18px rgba(0,0,0,0.35);
    }
    body.sidebar-open {
        overflow: hidden;
    }
    body.sidebar-open .content-wrapper::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1045;
    }
    .content-wrapper,
    .main-footer {
        margin-left: 0 !important;
        left: 0 !important;
    }
    .main-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        background: rgba(255,255,255,0.95);
        z-index: 1030;
        margin-top: 0;
    }
    .wrapper {
        padding-bottom: 4rem; /* reserva para footer fixo no mobile */
    }
}

.card {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.card.hover-raise {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.card.hover-raise:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.card .icon-pulse {
    transition: transform 0.2s ease;
}

.card:hover .icon-pulse {
    transform: scale(1.08) rotate(-3deg);
}

.small-box {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.small-box .icon {
    opacity: 0.25;
    top: 12px;
}

.small-box .inner h3 {
    font-size: 1.9rem;
    font-weight: 700;
}

.badge {
    font-weight: 600;
}

.table thead th {
    border-bottom: 2px solid #e5e7eb;
    color: #0f172a;
}

.table > :not(:last-child) > :last-child > * {
    border-bottom: none;
}

.dropzone {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: background .2s ease, border-color .2s ease;
}

.dropzone.dz-drag-hover {
    border-color: #3b82f6;
    background: #e0f2fe;
}

.info-box.pointer {
    cursor: pointer;
}

.info-box.pointer .info-box-icon i {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.info-box.pointer:hover .info-box-icon i {
    transform: scale(1.12) rotate(-4deg);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.7rem;
}
[data-contrato-procedimento-list] {
    max-height: 320px;
    overflow-y: auto;
}
[data-contrato-secretaria-list],
[data-contrato-entidade-list],
[data-contrato-modalidade-list],
[data-contrato-fornecedor-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-arp-fornecedor-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-pagamento-fornecedor-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-fin-contrato-fornecedor-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-fin-diaria-secretaria-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-fin-certidao-fornecedor-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-os-contrato-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-relatorio-proc-modalidade-list],
[data-relatorio-proc-secretaria-list],
[data-relatorio-proc-tipoobjeto-list] {
    max-height: 320px;
    overflow-y: auto;
}

[data-contrato-secretaria-list] .dropdown-item,
[data-contrato-entidade-list] .dropdown-item,
[data-contrato-modalidade-list] .dropdown-item,
[data-contrato-fornecedor-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-arp-fornecedor-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-pagamento-fornecedor-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-fin-contrato-fornecedor-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-fin-diaria-secretaria-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-fin-certidao-fornecedor-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-os-contrato-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-relatorio-proc-modalidade-list] .dropdown-item,
[data-relatorio-proc-secretaria-list] .dropdown-item,
[data-relatorio-proc-tipoobjeto-list] .dropdown-item {
    white-space: normal;
    word-break: break-word;
}

[data-contrato-secretaria-label],
[data-contrato-entidade-label],
[data-contrato-modalidade-label],
[data-contrato-fornecedor-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-arp-fornecedor-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-pagamento-fornecedor-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-fin-contrato-fornecedor-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-fin-diaria-secretaria-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-fin-certidao-fornecedor-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-os-contrato-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}

[data-relatorio-proc-modalidade-label],
[data-relatorio-proc-secretaria-label],
[data-relatorio-proc-tipoobjeto-label] {
    display: block;
    white-space: normal;
    word-break: break-word;
}
