:root {
    --bg-main: #050816;
    --bg-sidebar: #020617;
    --bg-card: rgba(15, 23, 42, 0.94);
    --bg-card-soft: rgba(15, 23, 42, 0.75);
    --border-soft: rgba(148, 163, 184, 0.3);

    --text-main: #e5e7eb;
    --text-soft: #d1d5db;
    --text-muted: #9ca3af;

    --neon: #6366f1;
    --neon-soft: rgba(99, 102, 241, 0.15);
    --neon-strong: #a855f7;

    --danger-soft: rgba(248, 113, 113, 0.1);
    --success-soft: rgba(34, 197, 94, 0.12);
}

/* =========================
   BASE / GLOBAL
   ========================= */

body.app-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #111827 0, #020617 45%, #000000 100%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.app-wrapper {
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    margin-bottom: .35rem;
}

p {
    color: var(--text-soft);
}

.text-muted,
.text-secondary,
small {
    color: var(--text-muted) !important;
}

/* links */
a {
    color: #a5b4fc;
    text-decoration: none;
}

a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* =========================
   SIDEBAR
   ========================= */

.app-sidebar {
    width: 250px;
    background: radial-gradient(circle at top, #020617 0, #020617 55%, #000000 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1.25rem 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.6);
}

.sidebar-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, var(--neon-strong), var(--neon));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1120;
    font-weight: 700;
    box-shadow: 0 0 18px rgba(129, 140, 248, 0.9);
}

.logo-letter {
    font-size: 18px;
}

.brand-small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.brand-big {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

/* navegação */

.sidebar-nav .nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    margin: 0.15rem 0;
    transition: all 0.15s ease-in-out;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
}

.sidebar-nav .nav-link:hover {
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.15), rgba(168, 85, 247, 0.18));
    color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.text-neon-sub {
    color: rgba(148, 163, 184, 0.9);
    font-size: 0.7rem;
}

/* Sidebar footer */

.sidebar-footer {
    margin-top: auto;
}

.btn-outline-neon {
    border-color: rgba(129, 140, 248, 0.65);
    color: #e5e7eb;
}

.btn-outline-neon:hover {
    background: radial-gradient(circle at top, rgba(129, 140, 248, 0.32), rgba(59, 130, 246, 0.25));
    border-color: rgba(129, 140, 248, 0.9);
    color: #ffffff;
}

.user-mini-card {
    padding: 0.65rem 0.75rem;
    border-radius: 0.85rem;
    background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.12), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(129, 140, 248, 0.35);
}

.user-mini-card .user-name {
    font-size: 0.9rem;
}

.user-mini-card .user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================
   MAIN / TOPBAR
   ========================= */

.app-main {
    background: radial-gradient(circle at top right, #020617 0, #020617 50%, #000000 100%);
}

.app-topbar {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-pill {
    border-radius: 999px;
    padding-inline: 0.6rem;
}

.bg-neon {
    background: radial-gradient(circle at 30% 0, #6366f1, #a855f7);
}

.topbar-user-name {
    font-size: 0.9rem;
}

.topbar-user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-content {
    padding-inline: 1.5rem;
}

.app-footer {
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    background: rgba(15, 23, 42, 0.98);
}

/* =========================
   CARDS / LAYOUT
   ========================= */

/* Override geral dos cards Bootstrap */
.card {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
}

.card-header,
.card-footer {
    background: var(--bg-card-soft);
    border-color: var(--border-soft);
    color: var(--text-soft);
}

.card-body {
    background: transparent;
    color: var(--text-soft);
}

.card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-soft);
}

/* Cards “vidro” se usares .card-glass adicional */
.card-glass {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(18px);
}

.card-glass .card-header {
    background: transparent;
}

/* metric cards do topo */
.metric-card {
    background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.25), rgba(15, 23, 42, 0.95));
    border-radius: 1rem;
    border: 1px solid rgba(129, 140, 248, 0.4);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.8);
}

.metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1120;
    box-shadow: 0 0 24px rgba(129, 140, 248, 0.9);
}

.bg-gradient-neon {
    background: radial-gradient(circle at 30% 0, #6366f1, #a855f7);
}

.bg-gradient-green {
    background: radial-gradient(circle at 30% 0, #22c55e, #4ade80);
}

.bg-gradient-red {
    background: radial-gradient(circle at 30% 0, #ef4444, #fb7185);
}

.bg-gradient-purple {
    background: radial-gradient(circle at 30% 0, #a855f7, #ec4899);
}

/* =========================
   BOTÕES
   ========================= */

.btn-neon {
    background: radial-gradient(circle at 30% 0, #6366f1, #a855f7);
    border: none;
    color: #f9fafb;
    box-shadow: 0 12px 30px rgba(129, 140, 248, 0.7);
}

.btn-neon:hover {
    filter: brightness(1.05);
    box-shadow: 0 16px 40px rgba(129, 140, 248, 0.95);
}

.btn-outline-neon {
    border-color: rgba(129, 140, 248, 0.65);
    color: #e5e7eb;
}

/* links especiais */

.link-neon {
    color: #a5b4fc;
    text-decoration: none;
}

.link-neon:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* =========================
   ALERTAS
   ========================= */

.alert-neon {
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    color: var(--text-main);
}

/* =========================
   TABELAS
   ========================= */

.table-dark {
    --bs-table-bg: rgba(15, 23, 42, 0.95);
    --bs-table-striped-bg: rgba(31, 41, 55, 0.8);
    --bs-table-hover-bg: rgba(30, 64, 175, 0.2);
}

.badge.bg-success-soft {
    background: var(--success-soft);
}

.badge.bg-danger-soft {
    background: var(--danger-soft);
}

/* Category pill */

.category-pill {
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    font-size: 0.85rem;
}

/* =========================
   PROGRESSO / INSIGHTS
   ========================= */

.progress-neon {
    height: 0.7rem;
    background-color: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
}

.progress-neon .progress-bar {
    background: linear-gradient(90deg, #22c55e, #a3e635);
    border-radius: 999px;
}

/* Misc */

.min-vh-75 {
    min-height: 75vh;
}

.text-neon {
    color: #a5b4fc;
}

.insight-item {
    font-size: 0.9rem;
}
