/* Admin SaaS — visual neutro (ferramenta, não convite) */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f1f4;
    --border: #e4e6eb;
    --border-strong: #d0d3da;
    --text: #14161a;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;
    --accent: #1c1f26;
    --accent-hover: #000000;
    --accent-soft: #eef0f3;
    --focus: #3b82f6;
    --success: #047857;
    --success-bg: #ecfdf5;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.04);
    --radius: 10px;
    --radius-sm: 8px;
    --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}

a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent);
}

/* ——— Login ——— */

.pagina-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 480px at 50% -20%, #e8eaef 0%, transparent 60%),
        var(--bg);
}

.card-login {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 28px 28px;
    box-shadow: var(--shadow);
}

.card-login .marca-admin {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 18px;
}

.card-login h1 {
    margin: 0 0 8px;
    text-align: center;
    color: var(--text);
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.subtitulo {
    text-align: center;
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

.links-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.links-login .link-voltar {
    margin-top: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.links-login .link-voltar:hover {
    color: var(--text);
    text-decoration: underline;
}

.link-esqueci-wrap {
    margin: 14px 0 0;
    text-align: center;
}

.link-esqueci {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.link-esqueci:hover {
    color: var(--text);
    text-decoration: underline;
}

.campo-dica-admin {
    margin: -4px 0 14px;
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.4;
}

.campo-dica-admin code {
    font-size: 11px;
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: 4px;
}

.site-ativo-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ——— Forms ——— */

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--border-strong);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button,
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn-primario {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primario:hover {
    background: var(--accent-hover);
}

.btn-primario:disabled {
    background: var(--border-strong);
    color: var(--text-soft);
    cursor: not-allowed;
}

.btn-secundario {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secundario:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.btn-perigo {
    background: var(--danger);
    color: #fff;
}

.btn-perigo:hover {
    background: #991b1b;
}

.btn-aviso {
    background: var(--warning);
    color: #fff;
}

.mensagem {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
}

.mensagem.erro {
    color: var(--danger);
}

.mensagem.sucesso {
    color: var(--success);
}

/* ——— Shell / header ——— */

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

.topo-admin {
    background: var(--surface);
    color: var(--text);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
}

.topo-admin h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.topo-admin span {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 1;
}

.topo-acoes {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-sair {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-sair:hover {
    background: var(--surface-2);
    color: var(--text);
}

.link-site {
    color: var(--text);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}

.link-site:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.conteudo-admin {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ——— Tabs ——— */

.abas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.aba {
    flex: 1 1 120px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-weight: 550;
    font-size: 13px;
}

.aba:hover {
    background: var(--surface-2);
    color: var(--text);
}

.aba.ativa {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.painel-aba {
    display: none;
}

.painel-aba.ativo {
    display: block;
}

.subtitulo-card {
    margin: 22px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dica-admin {
    font-size: 13px;
    color: var(--text-muted);
    font-style: normal;
    margin: 0 0 16px;
    line-height: 1.4;
}

.check-linha {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.check-linha input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.bloco-local-festa {
    margin: 8px 0 16px;
    padding: 14px 14px 4px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.linha-dupla {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.cores-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.cores-grid label small {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.2;
}

.cores-grid input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 2px;
    margin-bottom: 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.subtitulo-mini {
    margin: 4px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.paletas-tema {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.paleta-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.paleta-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.paleta-card.ativa {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.paleta-swatches {
    display: flex;
    gap: 4px;
    height: 30px;
}

.paleta-swatches span {
    flex: 1;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.07);
}

.paleta-card-nome {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.paleta-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.25;
}

.seletor-site-admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.seletor-site-admin label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.seletor-site-admin select {
    min-width: min(100%, 280px);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 13px;
    background: var(--surface);
}

.fontes-nomes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.fonte-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.fonte-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.fonte-card.ativa {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.fonte-amostra {
    font-size: 22px;
    line-height: 1.1;
    color: var(--text);
    min-height: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fonte-card-nome {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.fonte-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.25;
}

.upload-bloco {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.upload-bloco:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.upload-bloco h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.preview-midia {
    display: none;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.contador-limite {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    font-style: normal;
}

.lista-carrossel-admin {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.item-carrossel-admin {
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.item-carrossel-admin img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.item-carrossel-admin .btn-secundario {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

@media (max-width: 640px) {
    .linha-dupla {
        grid-template-columns: 1fr;
    }

    .topo-admin {
        flex-wrap: wrap;
    }
}

.grid-admin {
    display: grid;
    gap: 16px;
}

@media (min-width: 800px) {
    .grid-admin {
        grid-template-columns: 1fr 1.15fr;
    }
}

.card-painel {
    background: var(--surface);
    border-radius: 12px;
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-painel h2 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

#form-presente.modo-edicao {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}

.preview-imagem {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    display: none;
    border: 1px solid var(--border);
}

.lista-itens {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: flex-start;
    background: var(--surface);
}

.item-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--surface-2);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-info strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
}

.item-info p {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text-muted);
}

.badge.comprado {
    background: var(--warning-bg);
    color: var(--warning);
}

.acoes-item {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.acoes-item button {
    padding: 6px 10px;
    font-size: 12px;
}

.tabela-presenca {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tabela-presenca th,
.tabela-presenca td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.tabela-presenca th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-sim {
    color: var(--success);
    font-weight: 600;
}

.status-nao {
    color: var(--danger);
    font-weight: 600;
}

.resumo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .resumo {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.tabela-historico td strong {
    color: var(--text);
}

.tabela-recados-wrap {
    width: 100%;
    overflow: hidden;
}

.tabela-recados {
    table-layout: fixed;
    width: 100%;
}

.tabela-recados .col-nome {
    width: 22%;
}

.tabela-recados .col-msg {
    width: 48%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

.tabela-recados .col-data {
    width: 18%;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.tabela-recados .col-acao {
    width: 12%;
    text-align: right;
    white-space: nowrap;
}

.tabela-recados .btn-excluir-recado {
    padding: 6px 10px;
    font-size: 12px;
}

@media (max-width: 640px) {
    .tabela-recados .col-nome { width: 26%; }
    .tabela-recados .col-msg { width: 42%; }
    .tabela-recados .col-data { width: 16%; font-size: 10px; }
    .tabela-recados .col-acao { width: 16%; }
}

/* Qualidade do site (checklist discreto) */
.qualidade-site-card {
    border: 1px solid var(--border);
    background: #fafafa;
}

.qualidade-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.qualidade-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.qualidade-dica {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

#qualidade-pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    min-width: 3.2em;
    text-align: right;
}

.qualidade-barra {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-bottom: 12px;
}

.qualidade-barra-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6b7280, #374151);
    transition: width 0.35s ease, background 0.35s ease;
}

.qualidade-barra-fill.alta {
    background: linear-gradient(90deg, #4b7c5a, #2f5d3f);
}

.qualidade-faltas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qualidade-faltas li {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 14px;
    position: relative;
    line-height: 1.35;
}

.qualidade-faltas li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ca3af;
}

.qualidade-ok {
    margin: 0;
    font-size: 12px;
    color: #2f5d3f;
}

.resumo-card {
    flex: 1;
    min-width: 120px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
}

.resumo-card strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.resumo-card span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.vazio {
    color: var(--text-soft);
    font-style: normal;
    text-align: center;
    padding: 28px 16px;
    font-size: 14px;
}

.escondido {
    display: none !important;
}

.link-voltar {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

/* Toast */
#toast-container {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(90vw, 360px);
    pointer-events: none;
}

.toast {
    background: var(--accent);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast.visivel {
    opacity: 1;
    transform: translateY(0);
}

.toast-sucesso {
    background: var(--success);
}

.toast-erro {
    background: var(--danger);
}

.toast-info {
    background: var(--accent);
}
