:root {
    --azul-marinho: #1e2a5e;
    --azul-marinho-escuro: #141c42;
    --azul-claro: #4fc3f7;
    --azul-claro-escuro: #29a8e0;
    --cinza-fundo: #f4f6fb;
    --branco: #ffffff;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    background: var(--cinza-fundo);
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding-bottom: calc(70px + env(safe-area-inset-bottom)); /* espaco para o menu inferior nao cobrir o conteudo */
}
body.tem-acoes-fixas {
    padding-bottom: calc(140px + env(safe-area-inset-bottom)); /* soma espaco extra da barra de acao (ex: botao Salvar) */
}

/* ---------- Topo ---------- */
.app-header {
    background: linear-gradient(135deg, var(--azul-marinho) 0%, var(--azul-marinho-escuro) 100%);
    color: #fff;
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.app-header .brand {
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.app-header .brand .icone {
    width: 30px; height: 30px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}
.app-header a.logout {
    color: #cfe8fb;
    text-decoration: none;
    font-size: 1.25rem;
}

/* ---------- Barra de instalacao do PWA ---------- */
.banner-instalar {
    background: #fff;
    border-bottom: 1px solid #eceff5;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    position: sticky;
    top: 56px;
    z-index: 1020;
}
.banner-instalar img {
    width: 34px; height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}
.banner-instalar .btn-close { flex-shrink: 0; }

/* ---------- Barra inferior (navegacao mobile) ---------- */
.rodape-fixo {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    background: var(--branco);
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    padding-bottom: env(safe-area-inset-bottom);
}
.acoes-fixas {
    padding: .55rem 1rem;
    border-bottom: 1px solid #eceff5;
    display: flex;
    gap: .5rem;
}
.acoes-fixas .btn { border-radius: 50px; padding-top: .5rem; padding-bottom: .5rem; }
.bottom-nav {
    background: var(--branco);
    border-top: 1px solid #e3e7f1;
    display: flex;
    justify-content: space-around;
    padding: .35rem 0;
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    color: #8a93ab;
    text-decoration: none;
    font-size: .68rem;
    padding: .3rem 0;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--azul-marinho); font-weight: 600; }

/* ---------- Cartoes ---------- */
.card-app {
    background: var(--branco);
    border-radius: 14px;
    border: 1px solid #eceff5;
    box-shadow: 0 2px 10px rgba(30,42,94,.05);
}

.stat-card {
    background: var(--branco);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #eceff5;
}
.stat-card .valor {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--azul-marinho);
}
.stat-card .rotulo {
    font-size: .75rem;
    color: #8a93ab;
}

.btn-primario {
    background: var(--azul-marinho);
    border-color: var(--azul-marinho);
    color: #fff;
}
.btn-primario:hover { background: var(--azul-marinho-escuro); color: #fff; }

.badge-confirmado { background: #2e7d32; }
.badge-pendente { background: #f0a500; }
.badge-recusado { background: #c62828; }

.fab {
    position: fixed;
    right: 1rem;
    bottom: 84px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--azul-claro);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 14px rgba(79,195,247,.5);
    z-index: 1025;
    text-decoration: none;
}
.fab:hover { background: var(--azul-claro-escuro); color: #fff; }

.avatar-inicial {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--azul-marinho);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--azul-marinho) 0%, var(--azul-marinho-escuro) 100%);
    padding: 1rem;
}
.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 2rem 1.6rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-logo {
    width: 72px; height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: var(--azul-claro);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}

@media (min-width: 768px) {
    .container { max-width: 480px; }
}

.calendario-dia {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    position: relative;
    background: #fff;
    border: 1px solid #eceff5;
}
.calendario-dia.tem-evento { border-color: var(--azul-claro); }
.calendario-dia .ponto {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--azul-claro);
    position: absolute;
    bottom: 6px;
}
.calendario-dia.hoje { background: var(--azul-marinho); color: #fff; }
