/* Painel de Aniversários — Orizuru Tech
   Paleta herdada dos e-mails: #1a1a2e (escuro) + #a78bfa (destaque). */

:root {
    --escuro: #1a1a2e;
    --escuro-2: #24243e;
    --destaque: #a78bfa;
    --destaque-forte: #7c3aed;
    --texto: #1f2937;
    --texto-fraco: #6b7280;
    --borda: #e5e7eb;
    --fundo: #f4f4f7;
    --ok: #059669;
    --alerta: #d97706;
    --erro: #dc2626;
    --raio: 10px;
}

* { box-sizing: border-box; }

/* O atributo hidden vale display:none pela folha do navegador, mas perde
   para qualquer regra display: do nosso CSS (ex.: .fundo-modal { flex }).
   Sem isto o popup fica aberto e invisível por cima da página, engolindo
   os cliques. */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
}

a { color: var(--destaque-forte); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */

.layout { display: flex; min-height: 100vh; }

.barra {
    width: 250px;
    flex-shrink: 0;
    background: var(--escuro);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.marca {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.marca-icone { font-size: 28px; }
.marca strong { display: block; font-size: 16px; color: #fff; }
.marca small { color: var(--destaque); font-size: 12px; }

.seletor { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.seletor label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin-bottom: 8px;
}
.seletor-lista { display: flex; flex-direction: column; gap: 2px; }
.seletor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 14px;
}
.seletor-item:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.seletor-item.ativo { background: var(--destaque-forte); color: #fff; }

.tag {
    font-size: 10px;
    font-style: normal;
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
}
.tag-sim { background: #1d4ed8; color: #dbeafe; }
.tag-off { background: #4b5563; color: #e5e7eb; }

.menu { display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; flex: 1; }
.menu a {
    padding: 10px 14px;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 14px;
}
.menu a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.menu a.ativo { background: rgba(167,139,250,.16); color: #fff; font-weight: 600; }

.barra-rodape {
    padding: 16px 24px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.barra-rodape a { color: #9ca3af; }

.conteudo { flex: 1; padding: 28px 34px; max-width: 1200px; }

/* ---------- Avisos ---------- */

.faixa-aviso {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: var(--raio);
    margin-bottom: 20px;
    font-size: 14px;
}

.avisos { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.aviso { padding: 12px 16px; border-radius: var(--raio); font-size: 14px; }
.aviso-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.aviso-erro { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---------- Cabeçalho de página ---------- */

.cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.cabecalho h1 { font-size: 24px; margin: 0 0 4px; }
.cabecalho p { margin: 0; color: var(--texto-fraco); font-size: 14px; }

/* ---------- Cartões / grid ---------- */

.cartao {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 20px;
    margin-bottom: 20px;
}
.cartao h2 { font-size: 16px; margin: 0 0 14px; }
.cartao h2 small { font-weight: 400; color: var(--texto-fraco); font-size: 13px; }

.grade { display: grid; gap: 18px; }
.grade-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grade-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.numero { text-align: center; padding: 18px; border-radius: var(--raio); background: #f9fafb; }
.numero .valor { font-size: 30px; font-weight: 700; }
.numero .rotulo { font-size: 12px; color: var(--texto-fraco); margin-top: 4px; }
.numero.verde .valor { color: var(--ok); }
.numero.ambar .valor { color: var(--alerta); }
.numero.vermelho .valor { color: var(--erro); }
.numero.roxo .valor { color: var(--destaque-forte); }

/* ---------- Tabelas ---------- */

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--texto-fraco);
    padding: 10px 12px;
    border-bottom: 2px solid var(--borda);
}
td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
tr:last-child td { border-bottom: none; }
.tabela-rolagem { overflow-x: auto; }

.vazio { text-align: center; padding: 36px 16px; color: #9ca3af; }

/* ---------- Formulários ---------- */

.campo { margin-bottom: 16px; }
.campo label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.campo .ajuda { font-weight: 400; color: var(--texto-fraco); font-size: 12px; display: block; margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--destaque);
    outline-offset: -1px;
    border-color: var(--destaque);
}
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 54px; height: 38px; padding: 2px; border: 1px solid var(--borda); border-radius: 8px; }
input[type=range] { width: 100%; }

.linha { display: flex; gap: 14px; flex-wrap: wrap; }
.linha > * { flex: 1; min-width: 150px; }

.caixa-marcar { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.caixa-marcar input { width: auto; }

/* ---------- Botões ---------- */

.botao {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--destaque-forte);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.botao:hover { background: #6d28d9; text-decoration: none; }
.botao.secundario { background: #fff; color: var(--texto); border-color: var(--borda); }
.botao.secundario:hover { background: #f9fafb; }
.botao.perigo { background: var(--erro); }
.botao.perigo:hover { background: #b91c1c; }
.botao.pequeno { padding: 5px 10px; font-size: 13px; }
.acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Editor de arte ---------- */

.editor { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .layout { flex-direction: column; } .barra { width: 100%; } }

.preview-area {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 16px;
    text-align: center;
    position: sticky;
    top: 20px;
}
.preview-area img { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.preview-vazio { padding: 60px 20px; color: #9ca3af; border: 2px dashed var(--borda); border-radius: 8px; }

.valor-controle {
    float: right;
    font-weight: 400;
    color: var(--destaque-forte);
    font-variant-numeric: tabular-nums;
}

.moldura-email {
    width: 100%;
    height: 640px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    background: #f4f4f4;
}

/* ---------- Login ---------- */

.login-tela {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 100%);
    padding: 20px;
}
.login-caixa {
    background: #fff;
    padding: 34px;
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-caixa h1 { margin: 0 0 6px; font-size: 22px; }
.login-caixa p.sub { margin: 0 0 22px; color: var(--texto-fraco); font-size: 14px; }

/* ---------- Diversos ---------- */

.pilula { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pilula-ok { background: #d1fae5; color: #065f46; }
.pilula-erro { background: #fee2e2; color: #991b1b; }
.pilula-sim { background: #dbeafe; color: #1e40af; }
.pilula-neutro { background: #f3f4f6; color: #4b5563; }

.paginacao { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.paginacao a, .paginacao span {
    padding: 6px 11px;
    border: 1px solid var(--borda);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.paginacao span.atual { background: var(--destaque-forte); color: #fff; border-color: var(--destaque-forte); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.discreto { color: var(--texto-fraco); font-size: 13px; }

/* ---------- Lista de aniversariantes ---------- */

.barra-filtros {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--borda);
}
.barra-filtros .busca { flex: 1; min-width: 220px; }
.barra-filtros select { width: auto; min-width: 140px; }
.limpar-filtro { font-size: 13px; color: var(--texto-fraco); }

.tabela-lista td { vertical-align: middle; }
.tabela-lista tr:hover td { background: #fafafa; }

.tabela-lista .linha-inativa .nome-texto,
.tabela-lista .linha-inativa .email-texto { opacity: .45; text-decoration: line-through; }

.tabela-lista .linha-hoje td { background: #fffbeb; }
.tabela-lista .linha-hoje:hover td { background: #fef3c7; }

.data-pilula {
    display: inline-block;
    padding: 4px 9px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #4b5563;
}
.linha-hoje .data-pilula { background: var(--alerta); color: #fff; }

.selo-hoje {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--alerta);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.acoes-linha { justify-content: flex-end; gap: 6px; }
.acoes-linha form { display: inline; }

.rodape-tabela {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.rodape-tabela .paginacao { margin-top: 0; }

/* ---------- Menu suspenso ---------- */

.menu-suspenso { position: relative; display: inline-block; }
.menu-suspenso-itens {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    min-width: 200px;
    z-index: 20;
    overflow: hidden;
}
.menu-suspenso-itens.aberto { display: block; }
.menu-suspenso-itens a {
    display: block;
    padding: 10px 14px;
    color: var(--texto);
    font-size: 14px;
}
.menu-suspenso-itens a:hover { background: #f9fafb; text-decoration: none; }
.menu-suspenso-nota {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--texto-fraco);
    background: #f9fafb;
    border-top: 1px solid var(--borda);
}

/* ---------- Aviso flutuante ---------- */

.aviso-flutuante {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--escuro);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    z-index: 50;
}
.aviso-flutuante.erro { background: var(--erro); }

.caixa-modelo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: #f9fafb;
}
.caixa-modelo h2 { margin-bottom: 6px; }

/* ---------- Gráfico de meses ----------
   Mesmas regras do PDF: uma hue só, coluna fina com topo arredondado e
   base quadrada, respiro de 2px entre vizinhas, grade recessiva e rótulo
   direto apenas no pico e no mês corrente. */

.grafico-meses {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 190px;
    padding-top: 8px;
}
.coluna-mes {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.coluna-valor {
    font-size: 11px;
    font-weight: 700;
    color: var(--texto);
    height: 16px;
    font-variant-numeric: tabular-nums;
}
.coluna-trilho {
    flex: 1;
    width: 100%;
    max-width: 24px;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid #c3c2b7;
}
.coluna-barra {
    width: 100%;
    background: #2a78d6;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height .2s;
}
.coluna-atual .coluna-barra { background: #0d366b; }
.coluna-rotulo {
    font-size: 11px;
    color: var(--texto-fraco);
    padding-top: 6px;
}
.coluna-atual .coluna-rotulo { color: var(--texto); font-weight: 700; }

.rotulo-periodo { font-size: 13px; font-weight: 600; }

/* ---------- Popup ---------- */

body.sem-rolagem { overflow: hidden; }

.fundo-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 30, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.modal-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--borda);
}
.modal-topo h2 { margin: 0; font-size: 17px; }

.modal-fechar {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--texto-fraco);
    cursor: pointer;
    padding: 0 4px;
}
.modal-fechar:hover { color: var(--texto); }

.modal-corpo { padding: 22px 24px 6px; overflow-y: auto; }

.modal-rodape {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--borda);
}

.modal-erro {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
