:root {
    --cor-primaria: #ea580c;
    --cor-primaria-escura: #c2410c;
    --cor-fundo: #f4f5f7;
    --cor-texto: #1f2933;
    --cor-borda: #e2e8f0;
    --cor-branco: #ffffff;
    --cor-verde: #22c55e;
    --cor-vermelho: #ef4444;
    --cor-cinza: #94a3b8;
    --sombra: 0 1px 3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--cor-fundo);
    color: var(--cor-texto);
}

a { color: var(--cor-primaria); text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
    background: #26292e;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar .titulo { font-size: 1.1rem; font-weight: 600; }
.topbar .usuario-info { font-size: 0.8rem; opacity: 0.85; }
.topbar a.sair { color: #fff; font-size: 0.85rem; border: 1px solid #555; padding: 6px 10px; border-radius: 6px; }

/* ---------- Nav inferior (mobile) ---------- */
.nav-inferior {
    position: sticky;
    bottom: 0;
    display: flex;
    background: var(--cor-primaria);
    z-index: 50;
}
.nav-inferior a {
    flex: 1;
    text-align: center;
    color: #fff;
    padding: 9px 4px 7px;
    font-size: 0.72rem;
    border-right: 1px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.nav-inferior a:last-child { border-right: none; }
.nav-inferior a.ativo { background: var(--cor-primaria-escura); font-weight: 600; }

/* ---------- Container ---------- */
.container { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 90px; }

/* ---------- Cards / listas ---------- */
.card {
    background: var(--cor-branco);
    border-radius: 10px;
    box-shadow: var(--sombra);
    padding: 16px;
    margin-bottom: 14px;
}
.lista-item {
    background: var(--cor-branco);
    border-radius: 10px;
    box-shadow: var(--sombra);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.lista-item .principal { font-weight: 600; }
.lista-item .secundario { font-size: 0.82rem; color: #64748b; }

/* ---------- Botões ---------- */
.botao {
    display: inline-block;
    background: var(--cor-primaria);
    color: #fff !important;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
    margin-top: 10px;
}
.botao.secundario { background: #64748b; }
.botao.perigo { background: var(--cor-vermelho); }
.botao.pequeno { width: auto; padding: 8px 12px; font-size: 0.85rem; margin-top: 0; }
.botao-flutuante {
    position: fixed;
    bottom: 74px;
    right: 18px;
    background: var(--cor-primaria);
    color: #fff;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    z-index: 40;
}

/* ---------- Formulários ---------- */
form label { display: block; margin-top: 12px; margin-bottom: 4px; font-size: 0.85rem; font-weight: 600; color: #475569; }
form input[type=text], form input[type=password], form input[type=email],
form input[type=date], form input[type=datetime-local], form input[type=tel],
form input[type=number], form select, form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}
form textarea { min-height: 90px; resize: vertical; }
.linha-form { display: flex; gap: 10px; }
.linha-form > div { flex: 1; }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #26292e; }
.login-box {
    background: #fff;
    padding: 32px 26px;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    text-align: center;
}
.login-box h1 { margin: 0 0 2px; font-size: 1.4rem; color: var(--cor-primaria-escura); }
.login-box h2 { margin: 0 0 18px; font-size: 1rem; color: #64748b; font-weight: 500; }
.login-box form { text-align: left; }

/* ---------- Alertas ---------- */
.alerta { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.9rem; }
.alerta-erro { background: #fee2e2; color: #991b1b; }
.alerta-sucesso { background: #dcfce7; color: #166534; }

/* ---------- Calendário mensal ---------- */
.calendario { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.calendario th { font-size: 0.72rem; color: #64748b; padding: 6px 2px; }
.calendario td {
    text-align: center;
    padding: 8px 2px;
    border: 1px solid var(--cor-borda);
    font-size: 0.85rem;
    background: #fff;
}
.calendario td.fora-mes { color: #cbd5e1; background: #f8fafc; }
.calendario td a { display: inline-flex; align-items: center; justify-content: center; color: inherit; width: 26px; height: 26px; border-radius: 50%; }
.calendario td.hoje { border: 2px solid var(--cor-primaria); font-weight: 700; }
.calendario td.tem-consulta a { background: #fdba8c; color: #7c2d12; font-weight: 700; }
.calendario .cabecalho-mes {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--cor-primaria); color: #fff; padding: 10px 14px; border-radius: 8px 8px 0 0;
    font-weight: 600;
}
.calendario .cabecalho-mes a { color: #fff; font-size: 1.2rem; padding: 0 8px; }

/* ---------- Status ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: #fff; }

/* ---------- Busca ---------- */
.busca-box { display: flex; gap: 8px; margin-bottom: 14px; }
.busca-box input { flex: 1; }

.texto-vazio { text-align: center; color: #94a3b8; padding: 30px 10px; }

.tag-papel { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; background: #e2e8f0; color: #475569; }

.input-prefixo { display: flex; align-items: stretch; }
.input-prefixo .prefixo {
    display: flex; align-items: center; padding: 0 10px;
    background: #f1f5f9; border: 1px solid var(--cor-borda); border-right: none;
    border-radius: 8px 0 0 8px; font-weight: 600; color: #475569; font-size: 0.95rem;
}
.input-prefixo input { border-radius: 0 8px 8px 0; }

.lista-dados { margin: 12px 0; display: flex; flex-direction: column; gap: 7px; }
.item-dado { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--cor-texto); }
.item-dado .icone { color: #94a3b8; }

.opcao-pagamento {
    display: flex; align-items: center; gap: 10px;
    border: 2px solid var(--cor-borda); border-radius: 8px;
    padding: 10px 14px; margin-top: 8px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.opcao-pagamento:has(input:checked) { border-color: var(--cor-primaria); background: #fff7ed; }
.opcao-pagamento.selecionada { border-color: var(--cor-primaria); background: #fff7ed; }
.opcao-pagamento input[type=radio] { width: auto; margin: 0; }
.opcao-pagamento-texto { display: flex; justify-content: space-between; align-items: center; flex: 1; font-weight: 600; }
.opcao-pagamento-total { color: #64748b; font-weight: 500; font-size: 0.88rem; }
