@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');

*,
::after,
::before {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    opacity: 1;
    overflow-y: scroll;
    margin: 0;
}

a {
    cursor: pointer;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

li {
    list-style: none;
}

h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.275rem;
    color: var(--bs-emphasis-color);
}

/* Layout for admin dashboard skeleton */

.wrapper {
    align-items: stretch;
    display: flex;
    width: 100%;
}

#sidebar {
    max-width: 264px;
    min-width: 264px;
    background: var(--bs-dark);
    transition: all 0.35s ease-in-out;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    width: 100%;
    background: var(--bs-dark-bg-subtle);
}

/* Sidebar Elements Style */

.sidebar-logo {
    padding: 1.15rem;
}

.sidebar-logo a {
    color: #e9ecef;
    font-size: 1.15rem;
    font-weight: 600;
}

.sidebar-nav {
    flex-grow: 1;
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
    margin-left: 0;
}

.sidebar-header {
    color: #e9ecef;
    font-size: .75rem;
    padding: 1.5rem 1.5rem .375rem;
}

a.sidebar-link {
    padding: .625rem 1.625rem;
    color: #e9ecef;
    position: relative;
    display: block;
    font-size: 0.875rem;
}

.sidebar-link[data-bs-toggle="collapse"]::after {
    border: solid;
    border-width: 0 .075rem .075rem 0;
    content: "";
    display: inline-block;
    padding: 2px;
    position: absolute;
    right: 1.5rem;
    top: 1.4rem;
    transform: rotate(-135deg);
    transition: all .2s ease-out;
}

.sidebar-link[data-bs-toggle="collapse"].collapsed::after {
    transform: rotate(45deg);
    transition: all .2s ease-out;
}

.avatar {
    height: 40px;
    width: 40px;
}

.navbar-expand .navbar-nav {
    margin-left: auto;
}

.content {
    flex: 1;
    max-width: 100vw;
    width: 100vw;
}

@media (min-width:768px) {
    .content {
        max-width: auto;
        width: auto;
    }
}

.card {
    box-shadow: 0 0 .875rem 0 rgba(34, 46, 60, .05);
    margin-bottom: 24px;
}

.illustration {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-emphasis-color);
}

.illustration-img {
    max-width: 150px;
    width: 100%;
}

/* Sidebar Toggle */

#sidebar.collapsed {
    margin-left: -264px;
}

/* Footer and Nav */

@media (max-width:767.98px) {
    /* Sidebar como overlay em mobile */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
        margin-left: -264px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    #sidebar.collapsed {
        margin-left: 0;
    }

    /* Overlay escuro quando sidebar aberto */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .navbar,
    footer {
        width: 100vw;
    }

    /* Ajustes de conteúdo em mobile */
    .main {
        width: 100%;
    }

    .content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Tabelas responsivas */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Botões maiores para toque */
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Campos de formulário */
    .form-control,
    .form-select {
        font-size: 16px; /* Previne zoom no iOS */
    }

    /* Cards e espaçamentos */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    /* Campo de senha na tabela */
    .senha-field {
        min-width: 200px;
        max-width: 100%;
    }

    /* Ajustes gerais de formulários */
    .mb-3,
    .mb-4 {
        margin-bottom: 1rem !important;
    }

    /* Headers mais compactos */
    h4, h5 {
        font-size: 1.1rem;
    }

    /* Botões de ação em tabelas */
    .btn-sm {
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.25rem;
    }
}

/* Theme Toggler */

.theme-toggle {
    position: fixed;
    top: 50%;
    transform: translateY(-65%);
    text-align: center;
    z-index: 10;
    right: 0;
    left: auto;
    border: none;
    background-color: var(--bs-body-color);
}

.theme-toggle .fa-moon,
.theme-toggle .fa-sun {
    display: none;
    cursor: pointer;
    padding: 10px;
    font-size: 1.25rem;
}

html[data-bs-theme="dark"] .theme-toggle .fa-moon {
    display: block;
    color: #FFF;
}

html[data-bs-theme="light"] .theme-toggle .fa-sun {
    display: block;
    color: #222;
}

/* Botões Primários - Cor do Logo Padoveze */
.btn-primary {
    --bs-btn-color: #fff !important;
    --bs-btn-bg: #1E3A8A !important;
    --bs-btn-border-color: #1E3A8A !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #1a327c !important;
    --bs-btn-hover-border-color: #1a327c !important;
    --bs-btn-focus-shadow-rgb: 30, 58, 138 !important;
    --bs-btn-active-color: #fff !important;
    --bs-btn-active-bg: #192e72 !important;
    --bs-btn-active-border-color: #192e72 !important;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125) !important;
    --bs-btn-disabled-color: #fff !important;
    --bs-btn-disabled-bg: #1E3A8A !important;
    --bs-btn-disabled-border-color: #1E3A8A !important;
}
