:root {
    --bg: #0f0f14;
    --bg-card: #1a1a22;
    --neon: #d946ef;
    --neon-cyan: #22d3ee;
    --text: #e5e5ec;
    --text-dim: #9494a8;
    --border: #2a2a35;
    --sucesso: #22c55e;
    --erro: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.logout-link {
    color: var(--neon-cyan);
    text-decoration: none;
    font-size: 0.9em;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2 { color: var(--text); }

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 320px;
    text-align: center;
}

.login-box h1 { font-size: 1.3em; margin-bottom: 20px; }

form label { display: block; text-align: left; margin: 10px 0 4px; font-size: 0.9em; color: var(--text-dim); }

input[type=text], input[type=password], input[type=date], input[type=number] {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f14;
    color: var(--text);
    font-size: 1em;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95em;
}

.btn-primario {
    background: linear-gradient(135deg, var(--neon), var(--neon-cyan));
    color: #0f0f14;
    margin-top: 16px;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 12px 0;
}

.alert-sucesso { background: rgba(34,197,94,0.15); border: 1px solid var(--sucesso); color: var(--sucesso); }
.alert-erro { background: rgba(239,68,68,0.15); border: 1px solid var(--erro); color: var(--erro); }

.semana-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.9em;
}

.col-nome { text-align: left; min-width: 180px; white-space: nowrap; }

th { background: #22222c; color: var(--neon-cyan); font-weight: 600; }

input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--neon); }

.filtro-periodo {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.totais {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cartao {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cartao span { color: var(--text-dim); font-size: 0.85em; }
.cartao strong { font-size: 1.5em; color: var(--neon-cyan); }

.linha-vazia { opacity: 0.45; }
.linha-inativa { opacity: 0.4; }

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 20px;
    align-items: center;
}

.form-inline input { width: auto; }

.novo-seguranca summary { cursor: pointer; list-style: none; }

/* ===== Mapa semanal e folhas de pagamento ===== */
.folhas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.folha {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.folha-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.folha-head span { font-size: 0.75em; color: var(--text-dim); }
.folha-periodo { font-size: 0.85em; color: var(--text-dim); margin-bottom: 10px; }

.folha-detalhe { width: 100%; background: transparent; }
.folha-detalhe td { text-align: left; border-bottom: 1px dashed var(--border); padding: 8px 4px; }
.folha-detalhe td:last-child { text-align: right; font-weight: 600; }
.folha-total td { color: var(--neon-cyan); font-size: 1.1em; border-bottom: none; }

.folha-assinatura { margin-top: 16px; font-size: 0.85em; color: var(--text-dim); }

.only-print { display: none; }

/* ===== Impressão ===== */
@media print {
    body { background: #fff; color: #000; }
    .no-print { display: none !important; }
    .only-print { display: block; }
    .print-title { text-align: center; margin-bottom: 16px; }
    .print-title h1 { font-size: 1.4em; margin: 0; }
    .container { max-width: 100%; padding: 0; }
    table { border: 1px solid #999; }
    th { background: #eee !important; color: #000 !important; }
    th, td { border: 1px solid #999; color: #000; }
    .folha { border: 1px solid #999; page-break-inside: avoid; break-inside: avoid; }
    .folha-head span, .folha-periodo, .folha-assinatura { color: #333; }
    .folha-total td { color: #000; }
    .folhas-grid { grid-template-columns: repeat(2, 1fr); }
}

.select-perfil {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f14;
    color: var(--text);
    font-size: 1em;
}
