html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

.btn-perfil {
    background: transparent;
    border: 1px solid #4a4d50;
    color: #c0c0c0;
    padding: 5px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-perfil:hover {
    border-color: #ffcc00;
    color: #ffcc00;
}

.btn-cadastrar {
    background-color: #007bff !important;
    color: white !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: background 0.2s !important;
}

.btn-voltarListagem {
    background-color: #6c757d !important;
    color: white !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: background 0.2s !important;
}

.btn-cadastrar:hover {
    background-color: #0056b3 !important;
}

.btn-voltarListagem:hover {
    background-color: #5a6268 !important;
}

.btn-cadastrar:disabled {
    background-color: #6c757d !important;
    cursor: not-allowed !important;
}

.btn-voltarListagem:disabled {
    background-color: #6c757d !important;
    cursor: not-allowed !important;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    height: 75px;
    background-color: #1a1d20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- NOVO LOGOTIPO DA BARRA SUPERIOR --- */
.brand-header {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #1a1d20 !important;
}

.brand-logo-header {
    max-height: 90px;
    width: auto;
    background: transparent !important;
    margin-top: -15px;
    /* Puxa o logo para cima no desktop */
}

.brand-text-header {
    display: flex;
    gap: 4px;
    font-family: 'Bebas Neue', cursive;
    font-size: 28px;
    letter-spacing: 1px;
}

.text-gold {
    color: #D4AF37;
}

.text-white {
    color: #ffffff;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-placeholder i {
    color: #ffcc00;
    font-size: 1.2rem;
}

.profile-text {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #ffffff;
}

.user-name {
    color: #ffcc00;
    font-weight: 700;
    font-size: 14px;
}

.notification-icon {
    color: #a0a0a0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.notification-icon:hover {
    color: #ffcc00;
}

.btn-sair {
    background: transparent;
    border: 1px solid #4a4d50;
    color: #c0c0c0;
    padding: 5px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-sair:hover {
    border-color: #ffcc00;
    color: #ffcc00;
}

/* Wrapper */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 75px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #212529;
    border-right: 1px solid #ddd;
    padding-top: 20px;
    flex-shrink: 0;
}

.nav-menu {
    list-style: none;
    padding: 0 15px;
    margin: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link-content i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    margin-right: 12px;
}

.nav-link.active .nav-link-content i {
    color: #ffffff;
}

/* Submenu */
.has-submenu {
    cursor: pointer;
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 0;
}

.submenu.active {
    display: block;
}

.submenu li a {
    text-decoration: none;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 0 8px 36px;
    display: block;
    transition: all 0.2s;
    cursor: pointer;
}

.submenu li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.arrow {
    transition: transform 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: space-between;
}

.content-wrapper {
    width: 100%;
    padding: 30px 40px;
    box-sizing: border-box;
}

.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1d20;
    margin: 0;
}

.breadcrumb {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.main-card {
    width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    min-height: 400px;
}

/* Footer */
.site-footer {
    background: #fff;
    padding: 3px 40px;
    border-top: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-link {
    color: #bca000;
    text-decoration: none;
    font-weight: 700;
}

/* Menu Mobile */
.btn-menu-mobile {
    display: none;
    background: transparent;
    border: none;
    color: #ffcc00;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-menu-mobile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 75px;
    left: 0;
    width: 100%;
    height: calc(100vh - 75px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.menu-overlay.active {
    display: block;
}

/* ============================================================
   RESPONSIVIDADE – TOP BAR E ELEMENTOS DA INTERFACE
   ============================================================ */

@media (max-width: 992px) {

    /* Ajuste para telas médias (antes de virar tablet) */
    .top-bar {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .btn-menu-mobile {
        display: block;
    }

    .botoes-acoes {
        justify-content: center;
    }

    .btn-cadastrar {
        padding: 14px !important;
        font-size: 16px !important;
    }

    .btn-voltarListagem {
        padding: 14px !important;
        font-size: 16px !important;
    }

    .btn-cadastrar {
        font-size: 15px !important;
        padding: 12px !important;
    }

    .btn-voltarListagem {
        font-size: 15px !important;
        padding: 12px !important;
    }

    .sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        height: 100vh;
        width: 260px;
        transition: left 0.3s ease;
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        padding-top: 20px;
        background-color: #212529;
    }

    .sidebar.active {
        left: 0;
    }

    .content-wrapper {
        padding: 15px;
    }

    .main-card {
        padding: 20px;
    }

    /* --- AJUSTES DA TOP BAR PARA TABLETS --- */
    .top-bar {
        padding: 0 10px;
        height: 60px;
        gap: 8px;
        /* Diminui o espaço entre os grupos para evitar colisão */
    }

    .user-info {
        gap: 8px;
    }

    .profile-text .welcome {
        display: none;
    }

    .user-name {
        font-size: 12px;
    }

    .btn-perfil,
    .btn-sair {
        padding: 4px 8px;
        font-size: 11px;
        border-width: 1px;
    }

    .notification-icon {
        font-size: 1rem;
    }

    .user-avatar-placeholder {
        width: 32px;
        height: 32px;
    }

    .user-avatar-placeholder i {
        font-size: 1rem;
    }

    /* ===== REMOÇÃO DO TEXTO NO TABLET/CELULAR ===== */
    .brand-text-header {
        display: none !important;
        /* Remove as palavras ACELERA SISTEMA para liberar espaço */
    }

    .brand-logo-header {
        max-height: 32px;
        margin-top: 0px;
        /* Como o texto sumiu, removemos a margem negativa do logo */
    }

    /* ===== CORREÇÃO DO SELETOR DE EMPRESA ===== */
    #empresa-select-container {
        margin-right: 5px !important;
    }

    #empresa-select-container button {
        font-size: 10px !important;
        padding: 4px 8px !important;
        min-width: auto !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 480px) {

    /* --- AJUSTES DA TOP BAR PARA CELULARES PEQUENOS --- */
    .top-bar {
        padding: 0 5px;
        height: 56px;
        gap: 6px;
    }

    .user-info {
        gap: 4px;
    }

    .btn-perfil,
    .btn-sair {
        padding: 3px 6px;
        font-size: 10px;
    }

    .user-name {
        font-size: 10px;
    }

    .notification-icon {
        display: none;
    }

    /* ===== REMOÇÃO DO TEXTO NO CELULAR (já removido, mas mantemos o estilo do logo) ===== */
    .brand-logo-header {
        max-height: 28px;
        margin-top: 0px;
    }

    #empresa-select-container button {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    /* Ajuste para os botões de ação em listagens */
    .botoes-acoes {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-voltar,
    .btn-novo,
    .btn-colunas {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 1rem;
    }
}