* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    background: #f5f5f5;
    color: #222;
}

.site-header {
    background: #1f2937;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-header a {
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
}

.site-header h1 a { margin-left: 0; font-size: 1.25rem; }

main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.filtros a {
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    white-space: nowrap;
}

.grid-itens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.card-item {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-item h3 { margin: 0.5rem 0 0.25rem; font-size: 1rem; }
.card-item p { margin: 0.15rem 0; font-size: 0.85rem; color: #555; }

.sem-capa {
    background: #e5e7eb;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 600;
    color: #6b7280;
}

.card-item img { width: 100%; border-radius: 6px; }

.disponibilidade { font-weight: 600; color: #16a34a; }

.form-busca, .form-login {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.form-login { flex-direction: column; max-width: 320px; }
.form-login label { display: flex; flex-direction: column; font-size: 0.9rem; }
.form-login input { padding: 0.5rem; margin-top: 0.25rem; }

button {
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.erro { color: #dc2626; font-weight: 600; }

.detalhe-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

.detalhe-item .capa {
    width: 220px;
}

.detalhe-item .capa img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.detalhe-item .capa .sem-capa {
    width: 220px;
    height: 300px;
}

@media (max-width: 600px) {
    .detalhe-item {
        grid-template-columns: 1fr;
    }
    .detalhe-item .capa,
    .detalhe-item .capa .sem-capa {
        width: 100%;
        max-width: 220px;
    }
}

.painel-resumo {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.card-resumo {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.card-resumo h3 { margin: 0; font-size: 1.8rem; }

.painel-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.painel-nav a {
    display: inline-block;
    background: #1f2937;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9rem;
}

.painel-nav a:hover {
    background: #374151;
}

.tabela-admin {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 1rem;
}

.tabela-admin th, .tabela-admin td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.tabela-admin th { background: #f3f4f6; }

.form-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 800px;
    margin-top: 1rem;
}

.form-item label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.form-item input, .form-item select, .form-item textarea {
    font-weight: normal;
    padding: 0.5rem;
    margin-top: 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.form-item .campo-completo { grid-column: 1 / -1; }

.form-item button { grid-column: 1 / -1; width: fit-content; }

.total-resultados {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.paginacao {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.paginacao a, .paginacao span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}

.paginacao a {
    background: #fff;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.paginacao a:hover { background: #f3f4f6; }

.paginacao .pagina-atual {
    background: #1f2937;
    color: #fff;
    font-weight: 600;
}

.site-footer {
    text-align: center;
}

.intro-acervo {
    color: #4b5563;
    max-width: 700px;
    margin: 0.5rem 0 1.5rem;
    line-height: 1.5;
}
