/* ConsigSIM — estilos base. Cores em tokens; tema escuro redefine os tokens. */

:root {
    --fundo: #f4f6f9;
    --superficie: #ffffff;
    --superficie-2: #eef1f5;
    --borda: #d9dee6;
    --texto: #1c2430;
    --texto-sutil: #5d6878;
    --primaria: #1f5fa8;
    --primaria-hover: #184c88;
    --primaria-texto: #ffffff;
    --verde: #1e7a46;
    --verde-fundo: #e3f4ea;
    --vermelho: #b42828;
    --vermelho-fundo: #fbe6e6;
    --amarelo: #8a6100;
    --amarelo-fundo: #fff3d1;
    --azul-fundo: #e5effa;
    --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
    --raio: 10px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --fundo: #12161c;
        --superficie: #1b2129;
        --superficie-2: #232b35;
        --borda: #333d4a;
        --texto: #e6eaf0;
        --texto-sutil: #9aa5b4;
        --primaria: #4d8fdb;
        --primaria-hover: #6aa3e4;
        --primaria-texto: #0d1218;
        --verde: #5cc98a;
        --verde-fundo: #183526;
        --vermelho: #f07878;
        --vermelho-fundo: #3d1c1c;
        --amarelo: #e8c060;
        --amarelo-fundo: #3a3018;
        --azul-fundo: #1b2d44;
        --sombra: 0 1px 2px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --fundo: #12161c;
    --superficie: #1b2129;
    --superficie-2: #232b35;
    --borda: #333d4a;
    --texto: #e6eaf0;
    --texto-sutil: #9aa5b4;
    --primaria: #4d8fdb;
    --primaria-hover: #6aa3e4;
    --primaria-texto: #0d1218;
    --verde: #5cc98a;
    --verde-fundo: #183526;
    --vermelho: #f07878;
    --vermelho-fundo: #3d1c1c;
    --amarelo: #e8c060;
    --amarelo-fundo: #3a3018;
    --azul-fundo: #1b2d44;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
a { color: var(--primaria); }
small { font-size: .82em; }
.sutil { color: var(--texto-sutil); }

/* ---------- Topo / menu ---------- */
.topo {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 1.5rem;
    padding: .6rem 1.25rem;
    background: var(--superficie);
    border-bottom: 1px solid var(--borda);
}
.marca {
    display: flex; align-items: center; gap: .5rem;
    color: var(--texto); text-decoration: none; font-size: 1.15rem;
}
.marca strong, .login-marca strong { color: var(--primaria); }
.menu { display: flex; gap: .25rem; flex: 1; }
.menu a {
    padding: .45rem .8rem; border-radius: 8px;
    color: var(--texto-sutil); text-decoration: none; font-weight: 500;
}
.menu a:hover { background: var(--superficie-2); color: var(--texto); }
.menu a.ativo { background: var(--azul-fundo); color: var(--primaria); }
.menu-botao { display: none; }

.conta { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tema-botao, .menu-botao {
    border: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
    border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
}
.conta-menu { position: relative; }
.conta-menu summary {
    list-style: none; display: flex; align-items: center; gap: .5rem;
    cursor: pointer; padding: .25rem .5rem; border-radius: 8px;
}
.conta-menu summary::-webkit-details-marker { display: none; }
.conta-menu summary:hover { background: var(--superficie-2); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--primaria); color: var(--primaria-texto); font-weight: 600;
}
.conta-lista {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px;
    background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
    box-shadow: var(--sombra); padding: .4rem; display: flex; flex-direction: column;
}
.conta-info { display: flex; flex-direction: column; gap: .15rem; padding: .5rem .6rem .7rem; border-bottom: 1px solid var(--borda); margin-bottom: .3rem; }
.conta-info small { color: var(--texto-sutil); }
.conta-lista a, .conta-lista button {
    display: block; width: 100%; text-align: left; padding: .5rem .6rem; border-radius: 6px;
    color: var(--texto); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer;
}
.conta-lista a:hover, .conta-lista button:hover { background: var(--superficie-2); }
.conta-lista form { margin: 0; }

/* ---------- Conteudo ---------- */
.conteudo { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.cabecalho-pagina { margin-bottom: 1.25rem; }
.cabecalho-pagina p { margin: 0; }

.cartao {
    background: var(--superficie); border: 1px solid var(--borda);
    border-radius: var(--raio); box-shadow: var(--sombra); padding: 1.25rem;
}
.cartao-estreito { max-width: 460px; }
.grade-2 { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 1.25rem; align-items: start; }

/* ---------- Atalhos do inicio ---------- */
.atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.atalho {
    display: flex; flex-direction: column; gap: .2rem;
    padding: 1.1rem; border-radius: var(--raio);
    background: var(--superficie); border: 1px solid var(--borda); box-shadow: var(--sombra);
    color: var(--texto); text-decoration: none;
}
a.atalho:hover { border-color: var(--primaria); }
.atalho small { color: var(--texto-sutil); }
.atalho-icone { font-size: 1.6rem; margin-bottom: .3rem; }
.atalho-em-breve { opacity: .55; }

/* ---------- Formularios ---------- */
.formulario { display: flex; flex-direction: column; gap: .9rem; }
.formulario label { display: flex; flex-direction: column; gap: .3rem; }
.formulario label > span { font-weight: 500; }
input, select, textarea {
    width: 100%; padding: .55rem .7rem; font: inherit; color: var(--texto);
    background: var(--superficie); border: 1px solid var(--borda); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaria); outline-offset: -1px; border-color: transparent; }
.campo-com-botao { display: flex; gap: .4rem; }
.campo-com-botao input { flex: 1; }
.acoes-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }

.botao {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .55rem 1rem; font: inherit; font-weight: 500; line-height: 1.2;
    color: var(--texto); background: var(--superficie); border: 1px solid var(--borda);
    border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.botao:hover { background: var(--superficie-2); }
.botao-primario { background: var(--primaria); border-color: var(--primaria); color: var(--primaria-texto); }
.botao-primario:hover { background: var(--primaria-hover); border-color: var(--primaria-hover); }
.botao-perigo { color: var(--vermelho); }
.botao-pequeno { padding: .3rem .6rem; font-size: .85rem; }
.botao-bloco { width: 100%; }

/* ---------- Alertas e selos ---------- */
.alerta { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alerta-sucesso { background: var(--verde-fundo); color: var(--verde); }
.alerta-erro { background: var(--vermelho-fundo); color: var(--vermelho); }
.alerta-aviso { background: var(--amarelo-fundo); color: var(--amarelo); }
.alerta-info { background: var(--azul-fundo); color: var(--primaria); }

.selo {
    display: inline-block; padding: .1rem .5rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; background: var(--superficie-2); color: var(--texto-sutil);
}
.selo-verde { background: var(--verde-fundo); color: var(--verde); }
.selo-amarelo { background: var(--amarelo-fundo); color: var(--amarelo); }
.selo-cinza { background: var(--superficie-2); color: var(--texto-sutil); }

/* ---------- Tabelas ---------- */
.tabela-rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { padding: .6rem .5rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: middle; }
.tabela th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-sutil); font-weight: 600; }
.linha-inativa td { opacity: .55; }
.celula-acoes { display: flex; gap: .35rem; justify-content: flex-end; }
.celula-acoes form { margin: 0; }

/* ---------- Login ---------- */
.login { min-height: calc(100vh - 6rem); display: grid; place-items: center; }
.login-cartao {
    width: 100%; max-width: 380px; padding: 2rem;
    background: var(--superficie); border: 1px solid var(--borda);
    border-radius: 14px; box-shadow: var(--sombra);
}
.login-marca { text-align: center; margin-bottom: 1.5rem; }
.login-marca h1 { font-size: 1.7rem; margin: .4rem 0 .1rem; font-weight: 400; }
.login-marca p { margin: 0; color: var(--texto-sutil); }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
    .topo { gap: .75rem; padding: .6rem 1rem; flex-wrap: wrap; }
    .menu-botao { display: block; order: 2; }
    .conta { order: 1; }
    .menu { display: none; order: 3; flex-basis: 100%; flex-direction: column; }
    .menu.aberto { display: flex; }
    .conta-nome { display: none; }
    .conteudo { padding: 1rem 1rem 2rem; }
    .grade-2 { grid-template-columns: 1fr; }
    .celula-acoes { flex-direction: column; align-items: stretch; }
}
