:root {
    --jur-navbar-bg: #1f2937;
    --jur-accent: #2563eb;
}

body {
    background: #f1f5f9;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Navbar superior ---------- */
.jur-navbar {
    background: var(--jur-navbar-bg);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .15);
    padding-top: .4rem;
    padding-bottom: .4rem;
}
.jur-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.jur-logo-pill {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    line-height: 0;
}
.jur-logo-pill img { height: 22px; width: auto; display: block; }
.jur-brand-label {
    font-size: 1rem;
    letter-spacing: .02em;
    border-left: 2px solid rgba(255, 255, 255, .25);
    margin-left: .2rem;
    padding-left: .6rem;
}

.jur-navbar .navbar-nav .nav-link {
    color: #cbd5e1;
    font-size: .92rem;
    padding: .5rem .9rem;
    border-radius: 6px;
}
.jur-navbar .navbar-nav .nav-link:hover,
.jur-navbar .navbar-nav .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .07); }
.jur-navbar .navbar-nav .nav-link.active,
.jur-navbar .navbar-nav .show > .nav-link { color: #fff; background: rgba(37, 99, 235, .35); }

.jur-navbar .navbar-text { color: #cbd5e1; }
.jur-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, .25);
}
.jur-navbar .dropdown-menu {
    font-size: .9rem;
    border: 0;
    box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .25);
}
.jur-navbar .dropdown-item.active,
.jur-navbar .dropdown-item:active { background: var(--jur-accent); }

/* ---------- Conteúdo ---------- */
.jur-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem;
}
.jur-pagehead { margin-bottom: 1.25rem; }
.jur-pagehead h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

/* ---------- Cards de métrica ---------- */
.jur-metric-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.jur-metric-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: #0f172a; }
.jur-metric-label { font-size: .82rem; color: #64748b; }
.jur-metric { transition: transform .12s ease; }
.jur-metric:hover { transform: translateY(-2px); }

/* ---------- Seletor de partes ---------- */
.jur-parte-picker { position: relative; }
.jur-parte-results {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    z-index: 20;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}
.jur-parte-results.show { display: block; }
.jur-parte-results .list-group-item { cursor: pointer; font-size: .88rem; }

/* ---------- Elenco da delegação ---------- */
.jur-roster-search { position: relative; }
.jur-roster-search .jur-parte-results { left: 0; right: 0; z-index: 30; }
#rosterList { max-height: 60vh; overflow-y: auto; }
.roster-row.roster-just-added { animation: jur-flash 1.2s ease-out; }
@keyframes jur-flash {
    from { background: #dbeafe; }
    to { background: transparent; }
}

/* ---------- Relatório ---------- */
.jur-report-item { padding: .8rem 0; border-bottom: 1px solid #e2e8f0; }
.jur-report-item:last-child { border-bottom: 0; }

/* ---------- Login ---------- */
.jur-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    padding: 1.5rem;
}
.jur-auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .45);
}
.jur-auth-brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.5rem;
}
.jur-auth-logo { height: 34px; width: auto; }
.jur-auth-brand strong { display: block; font-size: 1.1rem; }
.jur-auth-brand span { font-size: .8rem; color: #64748b; }

/* ---------- Voltar ao topo ---------- */
.jur-to-top {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--jur-navbar-bg);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .28);
    z-index: 1050;
    cursor: pointer;
}
.jur-to-top:hover { background: var(--jur-accent); }
.jur-to-top.show { display: flex; }

/* ---------- Formulários de edição: barra de ações no topo ---------- */
/* Os formulários de cadastro usam <form class="card jur-editform"> com um
   .card-footer (Voltar / Excluir / Salvar) no fim. Reordenamos o rodapé para
   o topo e o fixamos na rolagem, para o usuário não precisar ir até o fim da
   tela para salvar ou voltar. */
.jur-editform {
    display: flex;
    flex-direction: column;
}
.jur-editform > .card-footer {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 6;
    border-top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
    border-radius: .375rem .375rem 0 0;
}
.jur-editform > .card-body {
    border-radius: 0 0 .375rem .375rem;
}

/* ---------- Impressão ---------- */
@media print {
    .jur-to-top { display: none !important; }
    .jur-navbar, .collapse:not(.show), .btn, .card-footer, .jur-pagehead + .alert { display: none !important; }
    .jur-content { padding: 0; max-width: none; }
    .card { border: 0 !important; box-shadow: none !important; }
    .jur-editform > .card-footer { position: static; }
}
