:root {
    --app-primary: #0d6efd;
    --app-bg: #f4f6f9;
    --app-sidebar-width: 220px;
    --app-bottom-nav-height: 64px;
    --app-topbar-height: 56px;
}

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

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

/* ---------- Elementos compartilhados ---------- */

/* Marca ARIAD: PNG com o próprio glow embutido (ver public/assets/img/icons/mark.png),
   por isso o elemento é só um <img> sem fundo/cor — nada de badge colorido atrás. */
.app-logo {
    display: inline-block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.app-logo--lg {
    width: 56px;
    height: 56px;
}

.app-avatar-btn {
    width: 38px;
    height: 38px;
}

/* ---------- Shell autenticado ---------- */

.app-shell {
    min-height: 100vh;
    padding-bottom: var(--app-bottom-nav-height);
}

.app-topbar {
    height: var(--app-topbar-height);
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-body {
    display: flex;
    min-height: calc(100vh - var(--app-topbar-height));
}

.app-sidebar {
    width: var(--app-sidebar-width);
    background: #fff;
    border-right: 1px solid #eef0f3;
    padding: 1rem 0.75rem;
    gap: 0.25rem;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
}

.app-nav-link i {
    width: 1.1rem;
    text-align: center;
    color: #8a93a3;
}

.app-nav-link:hover {
    background: #f1f3f9;
}

.app-nav-link.active {
    background: rgba(13, 110, 253, 0.1);
    color: var(--app-primary);
}

.app-nav-section {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #b0b7c3;
    padding: 1rem 0.9rem 0.35rem;
}

.app-offcanvas {
    max-height: 60vh;
}

.app-nav-link.active i {
    color: var(--app-primary);
}

.app-content {
    flex: 1;
    padding: 1.25rem;
    max-width: 1100px;
}

@media (min-width: 768px) {
    .app-content {
        padding: 2rem;
    }
}

/* ---------- Navegação inferior (mobile) ---------- */

.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--app-bottom-nav-height);
    background: #fff;
    border-top: 1px solid #eef0f3;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
}

.app-bottom-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: #8a93a3;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
}

.app-bottom-link i {
    font-size: 1.15rem;
}

.app-bottom-link.active {
    color: var(--app-primary);
}

.app-bottom-link--cta i {
    color: var(--app-primary);
}

/* ---------- Ajuda contextual ---------- */

.app-ajuda-toggle {
    position: fixed;
    right: 16px;
    bottom: calc(var(--app-bottom-nav-height) + 16px);
    z-index: 1040;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--app-primary);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-ajuda-toggle.ativo {
    background: #198754;
}

@media (min-width: 768px) {
    .app-ajuda-toggle {
        bottom: 24px;
    }
}

.app-ajuda-atual {
    outline: 2px dashed #198754;
    outline-offset: 2px;
    border-radius: 4px;
}

.app-ajuda-nav {
    position: fixed;
    left: 50%;
    bottom: calc(var(--app-bottom-nav-height) + 16px);
    transform: translate(-50%, 0);
    z-index: 1050;
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    max-width: calc(100vw - 32px);
    flex-wrap: wrap;
    justify-content: center;
}

.app-ajuda-nav.visivel {
    display: flex;
}

.app-ajuda-nav-contador {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.app-ajuda-nav-botoes {
    display: flex;
    gap: 0.4rem;
}

@media (min-width: 768px) {
    .app-ajuda-nav {
        bottom: 24px;
    }
}

/* ---------- Telas de autenticação ---------- */

.auth-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #eef3ff 0%, var(--app-bg) 220px);
    padding: 2rem 0;
}

.auth-wrapper {
    max-width: 440px;
    margin: 0 auto;
}

.auth-wrapper--wide {
    max-width: 640px;
}

/* ---------- Utilitários ---------- */

.stat-card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #8a93a3;
}

.empty-state i {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    display: block;
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
}

.is-invalid-feedback {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
