/**
 * Identidade visual MINJUSDH — bordô institucional e dourado (Cofre Geral de Justiça / minjusdh.gov.ao)
 */
body.minjusdh-brand,
body.login-page.minjusdh-brand {
    --mj-burgundy: #b01018;
    --mj-burgundy-dark: #8c0c12;
    --mj-burgundy-deep: #6a090e;
    --mj-burgundy-soft: #d00000;
    --mj-gold: #ffc000;
    --mj-gold-muted: #c5a059;
    --mj-gold-soft: #f8f0dc;
    --mj-on-red: rgba(255, 255, 255, 0.92);
    --mj-on-red-muted: rgba(255, 255, 255, 0.72);
    --navy: var(--mj-burgundy);
    --navy-2: var(--mj-burgundy-dark);
    --green: var(--mj-burgundy-soft);
    --green-dark: var(--mj-burgundy-dark);
    --green-soft: rgba(212, 175, 55, 0.18);
}

/* Área principal — sobrescrito por cofre-theme.css (fundo bordô institucional) */
body.minjusdh-brand.sigad-app {
    background: var(--bg);
    color: var(--text);
}

body.minjusdh-brand.sigad-app .topbar {
    background: var(--paper, #720c0c);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 0 -3px 0 var(--mj-gold);
}

body.minjusdh-brand.sigad-app .breadcrumb-line,
body.minjusdh-brand.sigad-app .breadcrumb-line strong {
    color: var(--text);
}

body.minjusdh-brand.sigad-app .breadcrumb-line i {
    color: var(--mj-burgundy);
}

body.minjusdh-brand.sigad-app .topbar .icon-button {
    background: #f4f6f9;
    border-color: var(--line);
    color: var(--mj-burgundy);
}

body.minjusdh-brand.sigad-app .topbar .icon-button:hover {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy-dark);
}

body.minjusdh-brand.sigad-app .topbar .quick-search {
    background: #f4f6f9;
    border-color: var(--line);
}

body.minjusdh-brand.sigad-app .topbar .quick-search input {
    color: var(--text);
}

body.minjusdh-brand.sigad-app .topbar .quick-search input::placeholder {
    color: var(--muted);
}

body.minjusdh-brand.sigad-app .topbar .profile-copy strong {
    color: var(--mj-burgundy);
}

body.minjusdh-brand.sigad-app .topbar .profile-menu {
    border-left-color: var(--line);
}

body.minjusdh-brand.sigad-app .topbar .avatar {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy-dark);
}

/* Barra lateral — dourado escuro (cofre-theme.css) */
body.minjusdh-brand .sidebar {
    background: var(--paper, #580606);
    border-right-color: var(--line);
}

body.minjusdh-brand .sidebar-caption {
    color: var(--muted);
}

body.minjusdh-brand .nav-link {
    color: var(--text);
}

body.minjusdh-brand .nav-link > i {
    color: var(--mj-burgundy-soft);
}

body.minjusdh-brand .nav-link:hover {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy);
}

body.minjusdh-brand .nav-link.active {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy-dark);
}

body.minjusdh-brand .sidebar-bottom {
    border-top-color: var(--line);
}

body.minjusdh-brand .logout-link {
    color: var(--muted);
}

body.minjusdh-brand .security-note {
    border-color: var(--line);
    background: var(--paper, #720c0c);
}

body.minjusdh-brand .security-note strong {
    color: var(--mj-burgundy);
}

body.minjusdh-brand .security-note small {
    color: var(--muted);
}

body.minjusdh-brand .brand.brand--text-only {
    min-height: 0;
    padding: 16px 16px 14px;
}

body.minjusdh-brand .brand.brand--text-only .brand-home {
    flex-direction: row;
    align-items: flex-start;
}

body.minjusdh-brand .brand.brand--banner {
    min-height: 0;
    padding: 12px 14px 10px;
}

body.minjusdh-brand .brand.brand--banner .brand-home {
    gap: 10px;
}

body.minjusdh-brand .brand-banner {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
}

body.minjusdh-brand .brand.brand--banner .brand-copy strong {
    font-size: 11px;
}

body.minjusdh-brand .brand.brand--banner .brand-copy small {
    font-size: 9px;
}

body.minjusdh-brand .brand {
    height: auto;
    min-height: 88px;
    padding: 14px 16px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    color: var(--mj-burgundy);
    background: var(--paper, #580606);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 0 -3px 0 var(--mj-gold);
}

body.minjusdh-brand .brand-home {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

body.minjusdh-brand .brand-home:hover {
    color: var(--mj-gold);
    opacity: 0.95;
}

body.minjusdh-brand .brand-logo {
    width: auto;
    max-width: 100%;
    height: 46px;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
    object-position: left center;
}

/* Logomarca oficial — moldura clara */
body.minjusdh-brand .brand-logo--official,
body.login-page.minjusdh-brand .login-brand-official {
    width: 100%;
    max-width: 210px;
    height: auto;
    max-height: none;
    padding: 10px 12px;
    background: #fff;
    border-radius: 10px;
    border: 2px solid rgba(255, 192, 0, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

body.minjusdh-brand .brand-home {
    flex-direction: column;
    align-items: flex-start;
}

body.login-page.minjusdh-brand .login-brand-official {
    max-width: 260px;
    margin-bottom: 4px;
}

body.minjusdh-brand .brand-copy strong {
    color: var(--mj-burgundy-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.minjusdh-brand .brand-copy small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

body.minjusdh-brand .nav-link.active::before {
    background: var(--mj-gold);
}

body.minjusdh-brand .nav-link.active > i,
body.minjusdh-brand .nav-link:hover > i {
    color: var(--mj-gold);
}

body.minjusdh-brand .btn-primary-action,
body.minjusdh-brand .btn-enter {
    background: var(--mj-burgundy);
    box-shadow: 0 4px 14px rgba(122, 15, 20, 0.22);
}

body.minjusdh-brand .btn-primary-action:hover,
body.minjusdh-brand .btn-enter:hover {
    background: var(--mj-burgundy-dark);
    color: #fff;
}

body.minjusdh-brand .page-eyebrow,
body.minjusdh-brand .login-eyebrow,
body.minjusdh-brand .eyebrow {
    color: var(--mj-burgundy-soft);
}

body.minjusdh-brand .live-dot {
    background: var(--mj-gold);
}

body.minjusdh-brand .text-link,
body.minjusdh-brand .popover-footer {
    color: var(--mj-burgundy);
}

body.minjusdh-brand .security-note > i {
    color: var(--mj-gold);
}

/* Painel — faixa Governo de Angola / MINJUSDH */
body.minjusdh-brand .dashboard-inst-banner {
    padding: 14px 18px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(28, 42, 37, 0.04);
}

body.minjusdh-brand .dashboard-inst-banner-img {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

body.minjusdh-brand .dashboard-home-v2 .dashboard-hero-top {
    border-color: var(--line);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 50%, #f4f7fa 100%);
}

body.minjusdh-brand .dashboard-home-v2 .dashboard-chip {
    border-color: var(--line);
    background: #fff;
}

/* Painel — bloco «Bem-vindo» (branco) */
body.minjusdh-brand .dashboard-hero {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 58%);
    border-color: var(--line);
    box-shadow: 0 1px 0 rgba(28, 42, 37, 0.04);
}

body.minjusdh-brand .dashboard-hero-title {
    color: var(--mj-burgundy-dark);
}

body.minjusdh-brand .dashboard-hero-meta {
    color: var(--muted);
}

body.minjusdh-brand .dashboard-hero .today-label {
    color: var(--muted);
}

body.minjusdh-brand .dashboard-hero .dashboard-hero-badge {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy-dark);
}

body.minjusdh-brand .dashboard-hero .btn-primary-action {
    background: var(--mj-burgundy);
    color: #fff;
    box-shadow: 0 4px 14px rgba(122, 15, 20, 0.18);
}

body.minjusdh-brand .dashboard-hero .btn-primary-action:hover {
    background: var(--mj-burgundy-dark);
    color: #fff;
}

body.minjusdh-brand .ministry-gold-line,
body.login-page.minjusdh-brand .ministry-gold-line {
    width: 100%;
    height: 0;
    margin: 10px 0 8px;
    border: 0;
    border-top: 3px solid var(--mj-gold);
    opacity: 0.95;
}

body.login-page.minjusdh-brand .login-aside-inner--logo-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
    text-align: center;
}

body.login-page.minjusdh-brand .login-logo-official {
    width: min(100%, 280px);
    height: auto;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 2px solid rgba(255, 192, 0, 0.5);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    object-fit: contain;
}

body.login-page.minjusdh-brand .login-institution-caption {
    margin: 0;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--muted);
}

/* Login — fundo claro / branco */
body.login-page.minjusdh-brand {
    background: #eef2f6;
}

body.login-page.minjusdh-brand .login-backdrop {
    background:
        radial-gradient(circle at 12% 18%, rgba(176, 16, 24, 0.06), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(255, 192, 0, 0.08), transparent 45%),
        linear-gradient(165deg, #eef2f6 0%, #f7f9fb 45%, #ffffff 100%);
}

body.login-page.minjusdh-brand .login-shell {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(16, 45, 80, 0.11);
}

body.login-page.minjusdh-brand .login-aside {
    background: #ffffff;
    color: var(--text);
    border-right: 1px solid var(--line);
}

body.login-page.minjusdh-brand .login-panel {
    background: #ffffff;
    border-left: 1px solid var(--line);
}

body.login-page.minjusdh-brand .login-panel h1,
body.login-page.minjusdh-brand .login-panel-header h1 {
    color: var(--mj-burgundy-dark);
}

body.login-page.minjusdh-brand .login-intro,
body.login-page.minjusdh-brand .login-footnote,
body.login-page.minjusdh-brand .form-label {
    color: var(--muted);
}

body.login-page.minjusdh-brand .login-footnote a {
    color: var(--mj-burgundy);
}

body.login-page.minjusdh-brand .login-input.form-control {
    background: #ffffff;
    border-color: #dce5ec;
    color: var(--text);
}

body.login-page.minjusdh-brand .login-input.form-control::placeholder {
    color: #9aa6b4;
}

body.login-page.minjusdh-brand .login-password-toggle {
    background: #f0f4f8;
    color: #52677c;
}

body.login-page.minjusdh-brand .login-theme-toggle {
    background: #f4f6f9;
    border-color: var(--line);
    color: var(--mj-burgundy);
}

body.login-page.minjusdh-brand .login-brand-lockup {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

body.login-page.minjusdh-brand .login-brand-banner:not(.login-brand-official) {
    width: min(100%, 320px);
    height: auto;
    max-height: 88px;
    object-fit: contain;
    object-position: left center;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: block;
}

body.login-page.minjusdh-brand .login-institution-lines {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mj-gold);
    line-height: 1.5;
}

body.login-page.minjusdh-brand .login-institution-lines li + li {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
}

body.login-page.minjusdh-brand .login-feature-icon {
    color: var(--mj-burgundy);
    background: var(--mj-gold-soft);
}

body.login-page.minjusdh-brand .login-eyebrow::before {
    background: var(--mj-burgundy);
}

body.login-page.minjusdh-brand .login-eyebrow {
    color: var(--mj-burgundy-soft);
}

body.login-page.minjusdh-brand .form-control:focus,
body.login-page.minjusdh-brand .login-input.form-control:focus {
    border-color: var(--mj-burgundy-soft);
    box-shadow: 0 0 0 3px rgba(122, 15, 20, 0.12);
}

body.login-page.minjusdh-brand .login-password-toggle:hover {
    background: var(--mj-gold-soft);
    color: var(--mj-burgundy);
}

body.login-page.minjusdh-brand .login-aside-meta {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
}

body.login-page.minjusdh-brand .login-aside-meta a {
    color: var(--mj-burgundy);
}

/* —— Modo escuro (DPJDH): anula fundos claros acima —— */
html[data-theme="dark"] body.minjusdh-brand.sigad-app {
    --bg: #0e141c;
    --canvas: #0e141c;
    --paper: #1a2332;
    --text: #e2e8f0;
    --muted: #8b98a8;
    --line: #2a3544;
    --white: #1a2332;
    --ink: #e2e8f0;
    --navy: #f0e6e6;
    --green-soft: rgba(255, 192, 0, 0.14);
    background: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar {
    background: rgba(20, 28, 38, 0.96);
    border-bottom-color: var(--line);
    box-shadow: inset 0 -3px 0 rgba(255, 192, 0, 0.55);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .breadcrumb-line,
html[data-theme="dark"] body.minjusdh-brand.sigad-app .breadcrumb-line strong {
    color: var(--text);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .icon-button {
    background: #1a2332;
    border-color: var(--line);
    color: #d4a8aa;
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .icon-button:hover {
    background: #222d3d;
    color: var(--mj-gold);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .quick-search {
    background: #1a2332;
    border-color: var(--line);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .quick-search kbd {
    background: #141c26;
    border-color: var(--line);
    color: var(--muted);
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .profile-copy strong {
    color: #e8c0c2;
}

html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .avatar {
    background: rgba(255, 192, 0, 0.18);
    color: var(--mj-gold);
}

html[data-theme="dark"] body.minjusdh-brand .sidebar {
    background: #141c26;
    border-right-color: var(--line);
}

html[data-theme="dark"] body.minjusdh-brand .brand {
    background: #141c26;
    border-bottom-color: var(--line);
    color: #e8c0c2;
    box-shadow: inset 0 -3px 0 rgba(255, 192, 0, 0.45);
}

html[data-theme="dark"] body.minjusdh-brand .brand-copy strong {
    color: #f0d0d2;
}

html[data-theme="dark"] body.minjusdh-brand .brand-copy small {
    color: var(--muted);
}

html[data-theme="dark"] body.minjusdh-brand .brand-home:hover {
    color: var(--mj-gold);
}

html[data-theme="dark"] body.minjusdh-brand .brand-banner {
    max-height: 48px;
    padding: 4px 6px;
    border-radius: 6px;
    background: #1a2332;
    border: 1px solid var(--line);
}

html[data-theme="dark"] body.minjusdh-brand .nav-link {
    color: #9aa8b8;
}

html[data-theme="dark"] body.minjusdh-brand .nav-link > i {
    color: #c8787c;
}

html[data-theme="dark"] body.minjusdh-brand .nav-link:hover {
    background: #1e2836;
    color: #f0d0d2;
}

html[data-theme="dark"] body.minjusdh-brand .nav-link.active {
    background: rgba(255, 192, 0, 0.12);
    color: #f8e6b0;
}

html[data-theme="dark"] body.minjusdh-brand .nav-link.active > i,
html[data-theme="dark"] body.minjusdh-brand .nav-link:hover > i {
    color: var(--mj-gold);
}

html[data-theme="dark"] body.minjusdh-brand .security-note {
    border-color: #3a2830;
    background: #1a2332;
}

html[data-theme="dark"] body.minjusdh-brand .security-note strong {
    color: #e8b0b4;
}

html[data-theme="dark"] body.minjusdh-brand .logout-link {
    color: var(--muted);
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-inst-banner {
    background: #1a2332;
    border-color: var(--line);
    box-shadow: none;
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-inst-banner-img {
    padding: 6px 8px;
    border-radius: 8px;
    background: #141c26;
    border: 1px solid var(--line);
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-hero {
    background: linear-gradient(165deg, #1a2830 0%, #1a2332 58%);
    border-color: var(--line);
    box-shadow: none;
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-hero-title {
    color: #f0e6e6;
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-hero-meta,
html[data-theme="dark"] body.minjusdh-brand .dashboard-hero .today-label {
    color: var(--muted);
}

html[data-theme="dark"] body.minjusdh-brand .dashboard-hero .dashboard-hero-badge {
    background: rgba(255, 192, 0, 0.16);
    color: #f8e6b0;
}

html[data-theme="dark"] body.minjusdh-brand .text-link,
html[data-theme="dark"] body.minjusdh-brand .popover-footer {
    color: #e8a8ac;
}

html[data-theme="dark"] body.minjusdh-brand .page-eyebrow,
html[data-theme="dark"] body.minjusdh-brand .eyebrow {
    color: #c8787c;
}

/* Login DPJDH em modo escuro */
html[data-theme="dark"] body.login-page.minjusdh-brand {
    background: #0a0f14;
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-backdrop {
    background:
        radial-gradient(circle at 12% 18%, rgba(176, 16, 24, 0.14), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(255, 192, 0, 0.08), transparent 45%),
        linear-gradient(165deg, #0a0f14 0%, #0e141c 45%, #0a1210 100%);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-shell,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-aside,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-panel {
    background: #1a2332;
    border-color: var(--line);
    color: var(--text);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-panel h1,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-panel-header h1 {
    color: #f0e6e6;
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-intro,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-footnote,
html[data-theme="dark"] body.login-page.minjusdh-brand .form-label,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-institution-caption,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-aside-meta {
    color: var(--muted);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-input.form-control {
    background: #141c26;
    border-color: var(--line);
    color: var(--text);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-password-toggle {
    background: #222d3d;
    color: #a8b4c4;
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-password-toggle:hover {
    background: #2a3544;
    color: var(--mj-gold);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-theme-toggle {
    background: #1a2332;
    border-color: var(--line);
    color: #c8d4e0;
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-logo-official,
html[data-theme="dark"] body.login-page.minjusdh-brand .login-brand-official {
    background: #141c26;
    border-color: rgba(255, 192, 0, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-feature-icon {
    background: rgba(255, 192, 0, 0.14);
    color: var(--mj-gold);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-institution-lines {
    color: var(--mj-gold);
}

html[data-theme="dark"] body.login-page.minjusdh-brand .login-institution-lines li + li {
    color: var(--muted);
}

@media (max-width: 760px) {
    html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .quick-search:focus-within,
    html[data-theme="dark"] body.minjusdh-brand.sigad-app .topbar .quick-search.is-open {
        background: #1a2332;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    }
}
