/* ============================================================
   PAINEL NEXUS - ESTILO PERSONALIZADO
   Arquivo de melhorias visuais sobre o tema base SB Admin
   ============================================================ */

:root {
    --nx-primary: #6366f1;
    --nx-primary-2: #8b5cf6;
    --nx-dark: #141a26;
    --nx-dark-2: #1d2433;
    --nx-success: #10b981;
    --nx-danger: #ef4444;
    --nx-warning: #f59e0b;
    --nx-info: #0ea5e9;
}

/* ---------- Fonte e fundo geral ---------- */
body {
    font-family: 'Nunito', 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fb;
    font-size: .95rem;
}

#wrapper #content-wrapper {
    background: linear-gradient(180deg, #f5f6fb 0%, #eef0f8 100%);
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, #171c26 0%, #1d2433 100%) !important;
    border-right: 1px solid rgba(255,255,255,.04);
}

.sidebar .sidebar-brand {
    padding: 1.5rem 1rem;
}

.sidebar .sidebar-brand .sidebar-brand-icon img {
    border: 3px solid rgba(255,255,255,.25);
    box-shadow: 0 4px 18px rgba(0,0,0,.45);
}

.sidebar .nav-item .nav-link {
    border-radius: .65rem;
    border-left: 4px solid transparent;
    margin: .15rem .55rem;
    padding: .55rem .9rem;
    font-weight: 600;
    color: #b6c2d6;
    transition: all .18s ease;
}

.sidebar .nav-item .nav-link:hover {
    background: rgba(99,102,241,.16);
    color: #fff;
    border-left-color: var(--nx-primary);
}

.sidebar .nav-item .nav-link i {
    color: #8b95ab;
    transition: color .18s ease;
}

.sidebar .nav-item .nav-link:hover i {
    color: #cfd3ff;
}

.sidebar .text-menu-header {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6f7a90;
    font-weight: 800;
    margin: 1.1rem .8rem .3rem .8rem;
}

.sidebar .sidebar-divider {
    border-color: rgba(255,255,255,.07);
}

.sidebar .collapse-inner {
    background: rgba(255,255,255,.05) !important;
    border-radius: .7rem;
}

.sidebar .collapse-inner .collapse-header {
    color: #98a2b8;
}

.sidebar .collapse-item {
    color: #b6c2d6;
    border-radius: .45rem;
}

.sidebar .collapse-item:hover {
    background: rgba(99,102,241,.16);
    color: #fff;
}

.nav-item2 {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: .6rem .6rem 0 .6rem;
}

.nav-item2 .nav-link2 {
    color: #8b95ab;
    font-size: .8rem;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #fff !important;
    border-bottom: 1px solid #e6e8f0;
    box-shadow: 0 2px 10px rgba(20,26,38,.06);
}

.topbar .h5.text-primary {
    color: var(--nx-primary) !important;
    font-weight: 800;
    font-size: 1.15rem;
}

.navbar-expand .navbar-nav .nav-link {
    padding-right: .5rem;
    padding-left: .5rem;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: .9rem;
    box-shadow: 0 4px 14px rgba(20,26,38,.07);
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(20,26,38,.12);
}

.card .card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f6;
    border-radius: .9rem .9rem 0 0;
}

.card.border-left-primary,
.card.border-left-success,
.card.border-left-info,
.card.border-left-warning,
.card.border-left-danger {
    border-left: 5px solid !important;
}

/* ---------- Botões ---------- */
.btn {
    border-radius: .6rem;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(120deg, var(--nx-primary), var(--nx-primary-2));
    border: none;
    box-shadow: 0 4px 12px rgba(99,102,241,.35);
}

.btn-primary:hover {
    background: linear-gradient(120deg, #5254e8, #7d4ce8);
    box-shadow: 0 6px 16px rgba(99,102,241,.45);
}

.btn-success {
    background: linear-gradient(120deg, var(--nx-success), #059669);
    border: none;
}

.btn-info {
    background: linear-gradient(120deg, var(--nx-info), #0284c7);
    border: none;
}

.btn-warning {
    background: linear-gradient(120deg, #fbbf24, var(--nx-warning));
    border: none;
    color: #000;
}

.btn-danger {
    background: linear-gradient(120deg, #f87171, var(--nx-danger));
    border: none;
}

.btn-icon-split {
    border-radius: .6rem;
}

/* ---------- Tabelas ---------- */
.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    color: #6f7a90;
    border-bottom: 2px solid #e6e8f0;
    background: #fafbff;
    white-space: nowrap;
}

.table tbody tr {
    transition: background .15s ease;
}

.table tbody tr:hover {
    background: #f7f8ff !important;
}

.table td, .table th {
    vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge-soft-success {
    background: #d1fae5;
    color: #047857;
    font-weight: 700;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #b45309;
    font-weight: 700;
}

.badge-soft-primary {
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 700;
}

.badge-soft-info {
    background: #cffafe;
    color: #0e7490;
    font-weight: 700;
}

/* ---------- Página de Login ---------- */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-bg::before,
.login-bg::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
}

.login-bg::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -80px;
    right: -80px;
}

.login-bg::after {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -100px;
    left: -60px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 1.4rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
    padding: 2.4rem 2.2rem;
    position: relative;
    z-index: 2;
    animation: login-in .5s ease;
}

@keyframes login-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.35);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    margin: 0 auto 0.6rem auto;
    display: block;
}

.login-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.55rem;
    text-align: center;
    letter-spacing: .02em;
    text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.login-subtitle {
    color: #a5b0c8;
    text-align: center;
    font-size: .85rem;
    margin-bottom: 1.4rem;
}

.login-card .form-control {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    border-radius: .7rem;
    padding: .75rem .95rem;
    font-weight: 600;
}

.login-card .form-control::placeholder {
    color: #8b95ab;
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, .12);
    border-color: #a5b4fc;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(165,180,252,.25);
}

.login-card .input-group-text {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #a5b0c8;
    border-radius: .7rem;
    cursor: pointer;
}

.login-card .password-toggle-icon.btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
}

.login-card .password-toggle-icon.btn:hover {
    background: rgba(255,255,255,.18);
}

.login-card label {
    color: #cbd5e1;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.btn-login {
    width: 100%;
    padding: .8rem;
    background: linear-gradient(120deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: .7rem;
    box-shadow: 0 8px 20px rgba(99,102,241,.5);
    transition: all .2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(99,102,241,.6);
    color: #fff;
}

.btn-app-download {
    width: 100%;
    padding: .7rem;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 700;
    border-radius: .7rem;
    transition: all .2s ease;
}

.btn-app-download:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.login-alert {
    background: rgba(254, 226, 226, .15);
    border: 1px solid rgba(254, 202, 202, .35);
    color: #fecaca;
    border-radius: .6rem;
    padding: .75rem;
    font-weight: 600;
}

/* ---------- Dashboard ---------- */
.stat-card {
    border-radius: 1rem;
    padding: 1.25rem 1.4rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(20,26,38,.12);
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(20,26,38,.18);
}

.stat-card .stat-icon {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 4.6rem;
    opacity: .22;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .8rem;
    opacity: .9;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: .2rem;
}

.stat-card.grad-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-card.grad-success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.grad-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.grad-danger  { background: linear-gradient(135deg, #f87171, #dc2626); }
.stat-card.grad-info    { background: linear-gradient(135deg, #38bdf8, #0284c7); }

.quick-action {
    border-radius: .9rem;
    transition: all .2s ease;
    border: 1px solid #e6e8f0;
    background: #fff;
    box-shadow: 0 4px 14px rgba(20,26,38,.06);
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(99,102,241,.18);
    border-color: #c7d2fe;
}

.quick-action .qa-icon {
    width: 52px;
    height: 52px;
    border-radius: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: .8rem;
}

.qa-icon.ic-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.qa-icon.ic-success { background: linear-gradient(135deg, #10b981, #059669); }
.qa-icon.ic-info    { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.qa-icon.ic-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.qa-icon.ic-danger  { background: linear-gradient(135deg, #f87171, #dc2626); }

/* ---------- Página de entrada / título ---------- */
.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: .25rem;
}

.page-subtitle {
    color: #6b7280;
    font-size: .88rem;
}

/* ---------- Alertas ---------- */
.alert {
    border-radius: .7rem;
    border: none;
    font-weight: 600;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ---------- Responsivo login ---------- */
@media (max-width: 767px) {
    .login-bg {
        background: #0f172a;
    }
    .login-card {
        padding: 1.8rem 1.4rem;
        border-radius: 1.1rem;
    }
}

/* ---------- Link desabilitado ---------- */
.disabled-link {
    pointer-events: none;
    opacity: .6;
}

/* ============================================================
   TEMA BRANCO / CLARO (Grafite / Branco)
   Ativado com a classe .theme-claro no <body>
   ============================================================ */
body.theme-claro .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e8eaf1;
}

body.theme-claro .sidebar .sidebar-brand-icon img {
    border-color: rgba(0, 0, 0, .08);
}

body.theme-claro .sidebar .text-menu-header {
    color: #9aa3b2;
}

body.theme-claro .sidebar .nav-item .nav-link {
    color: #3f4b63;
}

body.theme-claro .sidebar .nav-item .nav-link:hover {
    background: #eef0ff;
    color: #4f46e5;
}

body.theme-claro .sidebar .nav-item .nav-link i {
    color: #6b7280;
}

body.theme-claro .sidebar .nav-item .nav-link:hover i {
    color: #4f46e5;
}

body.theme-claro .sidebar .collapse-inner {
    background: #f5f6fb !important;
}

body.theme-claro .sidebar .collapse-header {
    color: #94a3b8;
}

body.theme-claro .sidebar .collapse-item {
    color: #3f4b63;
}

body.theme-claro .sidebar .collapse-item:hover {
    background: #eef0ff;
    color: #4f46e5;
}

body.theme-claro .nav-item2 {
    border-top: 1px solid #e8eaf1;
}

body.theme-claro .nav-item2 .nav-link2 {
    color: #6b7280;
}

body.theme-claro .topbar {
    background: #ffffff !important;
}