*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    min-height:100vh;
    background:#f4f7ff;
    color:#111827;
}

.btn-perfil-cat{
    position:fixed;
    top:20px;
    right:22px;
    z-index:1000;
}

.btn-perfil-cat img{
    width:54px;
    height:54px;
    border-radius:50%;
    object-fit:cover;
    cursor:pointer;
    border:3px solid #fff;
    box-shadow:0 8px 22px rgba(0,0,0,.15);
}

.categorias-page{
    margin-left:100px;
    padding:42px 55px 70px;
}

.categorias-hero{
    background:white;
    border-radius:28px;
    padding:38px;
    box-shadow:0 10px 28px rgba(0,0,0,.07);
    margin-bottom:24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
}

.badge-cat{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#ecfdf5;
    color:#047857;
    padding:9px 16px;
    border-radius:999px;
    font-weight:800;
    margin-bottom:16px;
}

.categorias-hero h1{
    font-size:44px;
    margin-bottom:10px;
}

.categorias-hero p{
    color:#4b5563;
    font-size:18px;
    line-height:1.55;
    max-width:760px;
}

#btnAtualizarCategorias{
    border:none;
    background:#7494ec;
    color:white;
    padding:13px 20px;
    border-radius:18px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap;
}

.categorias-toolbar{
    display:grid;
    grid-template-columns:1fr 220px 180px;
    gap:14px;
    margin-bottom:24px;
}

.campo-pesquisa-cat,
.categorias-toolbar select{
    height:50px;
    background:white;
    border:none;
    border-radius:18px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
    font-size:15px;
}

.campo-pesquisa-cat{
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 16px;
}

.campo-pesquisa-cat input{
    border:none;
    outline:none;
    background:transparent;
    width:100%;
    font-size:15px;
}

.categorias-toolbar select{
    padding:0 14px;
    outline:none;
    cursor:pointer;
}

.categorias-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
    gap:22px;
}

.categoria-card{
    background:white;
    border-radius:24px;
    padding:24px;
    box-shadow:0 8px 24px rgba(0,0,0,.07);
    display:flex;
    flex-direction:column;
    min-height:290px;
}

.categoria-icon{
    width:62px;
    height:62px;
    border-radius:18px;
    background:#edf2ff;
    color:#5277e8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:30px;
    margin-bottom:16px;
}

.categoria-card h2{
    font-size:20px;
    margin-bottom:10px;
    overflow:hidden;
    text-overflow:ellipsis;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.card-meta-cat{
    color:#6b7280;
    font-size:14px;
    margin-bottom:8px;
}

.badges-cat{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:10px 0 18px;
}

.badge-categoria{
    background:#ecfdf5;
    color:#047857;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.badge-publico{
    background:#dbeafe;
    color:#1d4ed8;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.badge-privado{
    background:#fee2e2;
    color:#b91c1c;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.card-categoria-select{
    margin-top:auto;
}

.card-categoria-select label{
    display:block;
    font-weight:800;
    margin-bottom:8px;
    color:#374151;
}

.card-categoria-select select{
    width:100%;
    height:42px;
    border:none;
    background:#f4f6fb;
    border-radius:15px;
    padding:0 12px;
    outline:none;
}

.estado-vazio{
    grid-column:1 / -1;
    background:white;
    padding:28px;
    border-radius:22px;
    text-align:center;
    color:#6b7280;
}

body.dark-mode{
    background:#121212;
    color:#e0e0e0;
}

body.dark-mode .categorias-hero,
body.dark-mode .campo-pesquisa-cat,
body.dark-mode .categorias-toolbar select,
body.dark-mode .categoria-card,
body.dark-mode .estado-vazio{
    background:#1f1f1f;
    color:#e0e0e0;
}

body.dark-mode .categorias-hero p,
body.dark-mode .card-meta-cat,
body.dark-mode .card-categoria-select label{
    color:#cbd5e1;
}

body.dark-mode .card-categoria-select select{
    background:#2a2a2a;
    color:#e0e0e0;
}

@media(max-width:900px){
    .categorias-page{
        margin-left:80px;
        padding:30px 18px 60px;
    }

    .categorias-hero{
        flex-direction:column;
        align-items:flex-start;
    }

    .categorias-hero h1{
        font-size:34px;
    }

    .categorias-toolbar{
        grid-template-columns:1fr;
    }
}
