body {
    font-family: "Inter", Arial, sans-serif;
    color: #0a0a0a;
    background:
        radial-gradient(circle at 0% 0%, rgba(10, 46, 110, 0.12), transparent 35%),
        radial-gradient(circle at 100% 20%, rgba(0, 0, 0, 0.06), transparent 30%),
        #ffffff;
    transition: background-color 0.25s ease, color 0.25s ease;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(120deg, rgba(10, 46, 110, 0.08), transparent 38%),
        linear-gradient(320deg, rgba(0, 0, 0, 0.05), transparent 40%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(10, 46, 110, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 46, 110, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.top-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(8px);
}

.navbar .nav-link {
    border-radius: 0.5rem;
    padding: 0.4rem 0.7rem;
    font-weight: 500;
    transition: all 0.22s ease;
}

.navbar-brand {
    color: #0a2e6e !important;
    letter-spacing: 0.8px;
    font-family: "Stardos Stencil", "Inter", Arial, sans-serif;
    font-size: 1.45rem;
    text-transform: uppercase;
    line-height: 1;
}

.navbar-brand .brand-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar-brand .brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.navbar-brand .brand-line-2 {
    font-size: 1em;
    letter-spacing: 0.6px;
    margin-top: 2px;
}

.navbar-brand:hover {
    color: #081f4c !important;
}

.navbar .nav-link.active {
    background: #e7edff;
    color: #0a2e6e;
}

.navbar .nav-link:hover {
    background: #eef2ff;
    color: #0a2e6e;
    transform: translateY(-1px);
}

.dropdown-menu {
    border-radius: 0.7rem;
    min-width: 220px;
    transform-origin: top center;
    animation: dropdownIn 0.18s ease;
}

.dropdown-item {
    border-radius: 0.45rem;
    font-size: 0.92rem;
    margin: 0.1rem 0.25rem;
    width: calc(100% - 0.5rem);
}

.dropdown-item:hover {
    background: #eef2ff;
    color: #0a2e6e;
}

.dropdown-item.active,
.dropdown-item:active {
    background: #0a2e6e;
    color: #fff;
}

/* Submenus (dropend) no menu horizontal */
.navbar .dropend > .dropdown-menu {
    top: 0;
    margin-top: -0.25rem;
}

.navbar .dropdown-menu .dropdown-item.dropdown-toggle::after {
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .navbar .dropend > .dropdown-menu {
        position: static !important;
        margin: 0.15rem 0 0.35rem 0.75rem;
        border-left: 3px solid #0a2e6e;
        border-radius: 0.4rem;
        box-shadow: none;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }
}

.page-header-strip {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.dot-sep {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0a2e6e;
    display: inline-block;
}

.topbar-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.topbar-subtitle {
    color: #64748b;
    font-size: 0.82rem;
}

.app-content {
    padding: 1.15rem;
    max-width: 1440px;
}

.app-content .h4,
.app-content .h5,
.app-content .h6 {
    font-weight: 700;
}

.hero-panel {
    color: #fff;
    background: linear-gradient(135deg, #061a3a, #0a2e6e 55%, #123f8f);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card {
    border: 1px solid #d9d9d9;
    border-radius: 0.85rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(2px);
    animation: fadeUp 0.35s ease both;
}

.card .card-body {
    padding: 1rem 1.1rem;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.btn-primary {
    background: #0a2e6e;
    border-color: #0a2e6e;
    box-shadow: 0 3px 10px rgba(10, 46, 110, 0.3);
}

.btn-primary:hover {
    background: #081f4c;
    border-color: #081f4c;
    transform: translateY(-1px);
}

.btn,
.form-control,
.form-select {
    min-height: 40px;
}

.btn {
    border-radius: 0.6rem;
    font-weight: 600;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
}

.btn-outline-secondary,
.btn-outline-primary {
    border-width: 1px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.login-box {
    border-top: 4px solid #0b5ed7;
}

body.page-login {
    min-height: 100vh;
}

body.page-login.theme-dark .login-box {
    border-top-color: #3b82f6;
}

.table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
    vertical-align: middle;
}

.table {
    --bs-table-striped-bg: #f8f8f8;
    --bs-table-hover-bg: #efefef;
    border-color: #d9d9d9;
    margin-bottom: 0;
}

.table thead th {
    background: #f3f5f9;
    color: #111111;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #d0d7e6;
}

.form-control,
.form-select {
    border-radius: 0.6rem;
    border-color: #bfc7d3;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: #0a2e6e;
    box-shadow: 0 0 0 0.18rem rgba(10, 46, 110, 0.2);
}

.alert {
    border-radius: 0.7rem;
    border-width: 1px;
}

.badge {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4em 0.62em;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.table tbody tr {
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.table tbody tr:hover {
    transform: translateX(2px);
}

.is-revealed {
    animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulseSoft {
    0% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.25); }
    70% { box-shadow: 0 0 0 8px rgba(29, 78, 216, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0); }
}

.alert-success {
    animation: pulseSoft 1.4s ease;
}

body.theme-dark {
    color: #f3f4f6;
    background: #0b1220;
}

body.theme-dark,
body.theme-dark .h1,
body.theme-dark .h2,
body.theme-dark .h3,
body.theme-dark .h4,
body.theme-dark .h5,
body.theme-dark .h6,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark h5,
body.theme-dark h6,
body.theme-dark p,
body.theme-dark li,
body.theme-dark span,
body.theme-dark label,
body.theme-dark th,
body.theme-dark td {
    color: #f3f4f6 !important;
}

body.theme-dark .navbar .nav-link,
body.theme-dark .dropdown-item,
body.theme-dark .topbar-title {
    color: #f3f4f6 !important;
}

body.theme-dark .navbar-brand {
    color: #ffffff !important;
}

body.theme-dark .navbar-brand:hover {
    color: #cbd5e1 !important;
}

body.theme-dark .navbar .nav-link.active,
body.theme-dark .dropdown-item.active {
    color: #ffffff !important;
    background: #1d4ed8 !important;
}

body.theme-dark .text-muted,
body.theme-dark .small.text-muted {
    color: #cbd5e1 !important;
}

body.theme-dark::before {
    background:
        radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.2), transparent 35%),
        radial-gradient(circle at 100% 20%, rgba(255, 255, 255, 0.06), transparent 28%),
        #0b1220;
}

body.theme-dark::after {
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
}

body.theme-dark .navbar,
body.theme-dark .page-header-strip,
body.theme-dark .card {
    background: #111827 !important;
    border-color: #1f2937 !important;
    color: #f3f4f6;
}

body.theme-dark .navbar {
    background: #0f172a !important;
    border-bottom-color: #1f2937 !important;
}

body.theme-dark .page-header-strip {
    background: #111827 !important;
}

body.theme-dark .navbar .nav-link:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

body.theme-dark .dropdown-menu {
    background: #111827 !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

body.theme-dark .dropdown-item {
    color: #f3f4f6 !important;
}

body.theme-dark .dropdown-item:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

body.theme-dark .navbar .dropend > .dropdown-menu {
    border-left-color: #3b82f6;
}

body.theme-dark .dropdown-item.dropdown-toggle {
    color: #f3f4f6 !important;
}

body.theme-dark .navbar-toggler {
    border-color: #334155;
}

body.theme-dark .navbar-toggler-icon {
    filter: invert(1) brightness(1.8);
}

body.theme-dark .topbar-subtitle,
body.theme-dark .small.text-muted,
body.theme-dark .form-label {
    color: #cbd5e1 !important;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #f3f4f6;
}

body.theme-dark .form-control::placeholder {
    color: #94a3b8;
}

body.theme-dark .table {
    color: #e5e7eb;
    --bs-table-striped-bg: #111827;
    --bs-table-hover-bg: #1f2937;
    border-color: #334155;
    background-color: #111827 !important;
}

body.theme-dark .table thead th {
    background: #0f172a;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

body.theme-dark .table > :not(caption) > * > * {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #0f172a !important;
}

body.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: #1f2937 !important;
}

body.theme-dark .table-responsive {
    border-radius: 0.6rem;
    background: #0b1220;
}

/* Responsividade global */
img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Em tabelas, botoes/acoes nao devem estourar no mobile */
.table td.d-flex,
.table td .d-flex {
    flex-wrap: wrap;
}

.table td.d-flex .btn,
.table td .d-flex .btn {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .app-content {
        padding: 0.85rem;
    }

    .topbar-title {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.15rem;
    }

    .navbar-brand .brand-logo {
        width: 28px;
        height: 28px;
    }

    .hero-panel {
        padding: 1rem !important;
    }

    .kpi-value {
        font-size: 1.45rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .page-header-strip {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .app-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
