:root {
    --sgo-primary: #0d6efd;
    --sgo-primary-dark: #0b4fc4;
    --sgo-surface: #ffffff;
    --sgo-bg: #f4f6fa;
    --sgo-border: #e5e9f0;
    --sgo-text: #1f2937;
    --sgo-muted: #6b7280;
    --sgo-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.06);
    --sgo-radius: 0.8rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-size: 0.94rem;
    color: var(--sgo-text);
    background-color: var(--sgo-bg) !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------------------------------ acessibilidade -- */

.skip-link {
    position: fixed;
    top: -4rem;
    left: 1rem;
    z-index: 2000;
    background: #fff;
    color: #111827;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.2);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 2px solid var(--sgo-primary);
    outline-offset: 2px;
}

/* ------------------------------------------------------------ login ---- */

#tela-login {
    background:
        radial-gradient(circle at 12% 18%, rgba(13, 110, 253, 0.16), transparent 32rem),
        radial-gradient(circle at 88% 82%, rgba(25, 135, 84, 0.14), transparent 30rem),
        linear-gradient(145deg, #f7f9fd, #eef2f9);
}

.login-card {
    width: min(24rem, calc(100vw - 2rem));
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.14);
}

.login-card .h4 {
    letter-spacing: -0.02em;
}

.login-card .login-logo {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: var(--sgo-primary);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.3);
}

/* ------------------------------------------------------------- topo ---- */

.navbar-sgo {
    min-height: 3.75rem;
    background: linear-gradient(100deg, #111827, #1f2a44) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.16);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.navbar-sgo .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    background: var(--sgo-primary);
    color: #fff;
    font-size: 1rem;
}

.navbar-acoes #obra-atual {
    min-width: 14rem;
}

.obra-seletor {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.obra-seletor i {
    font-size: 1rem;
}

#usuario-info i {
    font-size: 1.1rem;
    opacity: 0.85;
}

/* ------------------------------------------------------------ menu ----- */

aside.col-lg-2 {
    background: #fff !important;
    box-shadow: 0.35rem 0 1.5rem rgba(15, 23, 42, 0.035);
}

#menu {
    position: sticky;
    top: 4.75rem;
}

#menu .nav-link {
    color: #4b5563;
    border-radius: 0.6rem;
    padding: 0.55rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#menu .nav-link i {
    width: 1.2rem;
    text-align: center;
    font-size: 1rem;
    opacity: 0.9;
}

#menu .nav-link:hover {
    background-color: #eef4ff;
    color: var(--sgo-primary-dark);
}

#menu .nav-link.active {
    background-color: var(--sgo-primary);
    color: #fff;
    box-shadow: 0 0.45rem 1rem rgba(13, 110, 253, 0.25);
}

#menu .nav-link.active i {
    opacity: 1;
}

.menu-grupo {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* ---------------------------------------------------------- páginas ---- */

.pagina {
    display: none;
}

.pagina.ativa {
    display: block;
    animation: entrar-pagina 0.22s ease-out;
}

@keyframes entrar-pagina {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main h2.h4 {
    letter-spacing: -0.02em;
    font-weight: 700;
    color: #111827;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.page-header h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ----------------------------------------------------------- cards ----- */

.card {
    border: 1px solid var(--sgo-border);
    border-radius: var(--sgo-radius);
    background-color: var(--sgo-surface);
    box-shadow: var(--sgo-shadow);
    overflow: hidden;
}

.card-header {
    background-color: #fbfcfe;
    border-bottom: 1px solid var(--sgo-border);
    padding: 0.85rem 1.1rem;
}

.card-header .h6 {
    font-weight: 700;
    color: #111827;
}

.card-body {
    padding: 1.1rem;
}

.card-resumo {
    border-left: 4px solid var(--sgo-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-resumo:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.9rem 1.8rem rgba(15, 23, 42, 0.09);
}

.card-resumo .text-muted {
    font-weight: 500;
}

.card-resumo .h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------- formulários -- */

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.form-label.small {
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.form-control,
.form-select {
    border-color: #d7dde7;
    border-radius: 0.55rem;
    padding: 0.5rem 0.7rem;
}

.form-control-sm,
.form-select-sm {
    border-radius: 0.45rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(13, 110, 253, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.14);
}

.form-text {
    color: var(--sgo-muted);
}

/* ----------------------------------------------------------- botões ---- */

.btn {
    border-radius: 0.55rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    border-radius: 0.45rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--sgo-primary);
    border-color: var(--sgo-primary);
    box-shadow: 0 0.35rem 0.75rem rgba(13, 110, 253, 0.18);
}

.btn-primary:hover {
    background-color: var(--sgo-primary-dark);
    border-color: var(--sgo-primary-dark);
}

.btn-outline-secondary,
.btn-outline-dark {
    color: #374151;
    border-color: #cbd3df;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
    background-color: #eef1f6;
    color: #111827;
    border-color: #b9c3d2;
}

.btn i {
    line-height: 1;
}

/* botões de ação compactos em tabelas */
.table .btn-sm {
    white-space: nowrap;
}

/* ---------------------------------------------------------- tabelas ---- */

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--sgo-border);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    border-color: #eef1f6;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f8fbff;
}

.table tfoot th {
    border-top: 1px solid var(--sgo-border);
    background-color: #fbfcfe;
}

.table td,
.table th {
    vertical-align: middle;
}

/* --------------------------------------------------------- utilidades -- */

.status-locacao {
    min-width: 7.5rem;
    font-weight: 600;
}

.status-locacao.status-pendente {
    border-color: #f0c36d;
    background-color: #fff8e6;
    color: #8a5a00;
}

.status-locacao.status-pago {
    border-color: #8fd1a8;
    background-color: #eefaf2;
    color: #146c43;
}

.tabela-vazia {
    color: var(--sgo-muted);
    font-style: normal;
    border: 1px dashed #d5dce7;
    border-radius: 0.7rem;
    padding: 1.6rem 1rem;
    text-align: center;
    background-color: #fbfcfe;
}

.tabela-vazia::before {
    content: "\F4D0"; /* bootstrap-icons inbox */
    font-family: "bootstrap-icons";
    display: block;
    font-size: 1.5rem;
    opacity: 0.55;
    margin-bottom: 0.35rem;
}

.proxima-data {
    color: var(--sgo-muted);
    font-size: 0.8rem;
}

.campo-invalido {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.18rem rgba(220, 53, 69, 0.16);
}

.paginacao .page-link {
    cursor: pointer;
    border-radius: 0.45rem !important;
}

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 0.45rem;
    padding: 0.4em 0.6em;
}

.miniatura {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    border-radius: 0.38rem;
}

.modal-content {
    border: 0;
    border-radius: 0.9rem;
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.18);
}

.modal-header,
.modal-footer {
    border-color: #edf0f5;
}

.toast {
    border-radius: 0.7rem;
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.2);
}

.toast-icone {
    font-size: 1.05rem;
}

.nav-tabs {
    border-bottom-color: var(--sgo-border);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 600;
    padding: 0.6rem 0.8rem;
}

.nav-tabs .nav-link:hover {
    color: var(--sgo-primary);
}

.nav-tabs .nav-link.active {
    color: var(--sgo-primary);
    background: transparent;
    border-bottom-color: var(--sgo-primary);
}

.alert {
    border-radius: 0.6rem;
}

.min-vh-100 {
    min-height: 100vh;
}

#abertas-funcionario {
    min-width: 0;
    max-width: 100%;
}

/* --------------------------------------------------------- responsivo -- */

@media (max-width: 575.98px) {
    .navbar-sgo {
        flex-wrap: wrap;
        row-gap: 0.4rem;
    }

    .navbar-acoes {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.4rem !important;
    }

    .navbar-acoes #obra-atual {
        width: 100%;
        min-width: 0;
    }

    #usuario-info {
        flex: 1 1 auto;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    main {
        padding: 1rem !important;
    }

    .page-header {
        flex-direction: column;
    }

    .card-body {
        padding: 0.85rem;
    }
}

@media (max-width: 991.98px) {
    aside.col-lg-2 {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 1030;
        min-height: 0 !important;
        padding: 0 !important;
        border-top: 1px solid var(--sgo-border);
        border-right: 0 !important;
        background: #fff;
        box-shadow: 0 -0.5rem 1.5rem rgba(15, 23, 42, 0.08);
    }

    #menu {
        position: static;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center;
        overflow: visible;
        gap: 0.15rem !important;
        padding: 0.3rem !important;
    }

    #menu .text-muted {
        display: none;
    }

    #menu .nav-link {
        white-space: nowrap;
        font-size: 0.68rem;
        padding: 0.32rem 0.45rem;
        flex-direction: column;
        gap: 0.1rem;
        line-height: 1.15;
    }

    #menu .nav-link i {
        font-size: 1rem;
    }

    main {
        padding-bottom: 9rem !important;
    }
}
