@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Variáveis de Tema (Premium Violet - Match Landing Page) */
    --primary-color: #7c3aed; /* Violet 600 */
    --primary-hover: #6d28d9; /* Violet 700 */
    --secondary-color: #0f172a; /* Slate 900 */
    --accent-color: #a78bfa; /* Violet 400 */
    
    --bg-body: #f8fafc; /* Slate 50 */
    --bg-sidebar: #ffffff;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    
    --card-bg: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --sidebar-active-bg: #f5f3ff; /* Violet 50 */
    --sidebar-active-text: #7c3aed;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-lg: 1rem;
    --radius-xl: 1.5rem; /* 24px */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.18s ease;
    --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --elevate-1: 0 12px 28px rgba(15, 23, 42, 0.08);
    --elevate-2: 0 18px 38px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] {
    /* Variáveis Dark Mode */
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --bg-body: #0f172a; /* Slate 900 */
    --bg-sidebar: #1e293b; /* Slate 800 */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --card-bg: #1e293b;
    --border-color: #334155;
    --sidebar-active-bg: rgba(124, 58, 237, 0.15);
    --sidebar-active-text: #a78bfa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    
    /* Grid Pattern (Hero Style) */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Motion System */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: var(--transition-slow);
    will-change: transform, opacity;
}
.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-fast {
    transition: var(--transition-fast);
}
.reveal-scale {
    transform: scale(0.98);
}
.stagger > * {
    opacity: 0;
    transform: translateY(14px);
    transition: var(--transition-slow);
}
.stagger.reveal-visible > * {
    opacity: 1;
    transform: translateY(0);
}
.stagger.reveal-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.reveal-visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.reveal-visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.reveal-visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.reveal-visible > *:nth-child(5) { transition-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .stagger > *,
    .page-hero {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Transições Globais */
a, button, .btn, .card, input, select, textarea, .nav-link {
    transition: var(--transition-smooth);
}

/* Sidebar Premium (Clean) */
.sidebar {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 304px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid transparent;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background-image: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, rgba(255, 255, 255, 0) 32%);
    border-right: 1px solid rgba(124, 58, 237, 0.08);
}

.sidebar-header {
    padding: 32px 26px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar::after {
    content: "";
    position: absolute;
    top: 80px;
    right: -1px;
    width: 1px;
    height: calc(100% - 140px);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(148, 163, 184, 0));
    pointer-events: none;
}

.sidebar-toggle {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--text-main);
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.25);
}

.sidebar-toggle.active {
    color: #ffffff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.sidebar-status {
    margin: 0 16px 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.sidebar-status .status-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    font-weight: 700;
}

.sidebar-status .status-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

.sidebar-status .status-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-search {
    position: relative;
    margin: 0 16px 16px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.sidebar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.brand-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transition: transform 0.3s ease;
}

.sidebar-header:hover .brand-logo {
    transform: rotate(10deg) scale(1.05);
}

.brand-name {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

[data-bs-theme="dark"] .brand-name {
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-content {
    padding: 0 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 24px 0 12px 16px;
    opacity: 0.7;
}

.nav-section-divider {
    height: 1px;
    margin: 16px 14px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), rgba(124, 58, 237, 0.35), rgba(148, 163, 184, 0.2));
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 4px;
    font-size: 0.96rem;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.nav-link:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 999px;
    background: transparent;
    opacity: 0;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: rgba(0,0,0,0.02);
    transform: translateX(4px);
}

[data-bs-theme="dark"] .nav-link:hover {
    background-color: rgba(255,255,255,0.03);
}

.nav-link.active {
    color: var(--sidebar-active-text);
    background-color: var(--sidebar-active-bg);
    font-weight: 700;
    transform: translateX(4px);
}

.nav-link.active::before {
    background: var(--sidebar-active-text);
    opacity: 1;
}

.nav-link i {
    font-size: 1.15rem;
    margin-right: 12px;
    color: var(--text-muted);
    transition: color 0.2s;
}

@keyframes navPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@keyframes titleFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroCardIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes heroTitleIn {
    0% {
        opacity: 0;
        transform: translateY(16px);
        letter-spacing: 0.01em;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: -0.02em;
    }
}

@keyframes heroSubtitleIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroShimmerLine {
    from { transform: translateX(-100%); opacity: 0.25; }
    to { transform: translateX(240%); opacity: 0.7; }
}

.nav-link:hover i {
    animation: navPulse 0.45s ease;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(124, 58, 237, 0.12);
    color: var(--primary-color);
}

.nav-link.active i {
    color: var(--sidebar-active-text);
}

.nav-link:hover i {
    color: var(--text-main);
}

/* Submenu */
.submenu .nav-link {
    padding: 9px 16px 9px 42px;
    font-size: 0.9rem;
}

.sidebar-content .nav-link {
    animation: sidebarItemIn 0.35s ease both;
}

@keyframes sidebarItemIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu .nav-link::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--border-color);
    transition: all 0.2s;
}

.submenu .nav-link.active::before {
    background-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.01);
}

.sidebar.sidebar-collapsed {
    width: 96px;
}

.sidebar.sidebar-collapsed .brand-name,
.sidebar.sidebar-collapsed .nav-text,
.sidebar.sidebar-collapsed .nav-section-title,
.sidebar.sidebar-collapsed .sidebar-search,
.sidebar.sidebar-collapsed .sidebar-status,
.sidebar.sidebar-collapsed .submenu,
.sidebar.sidebar-collapsed .nav-section-divider,
.sidebar.sidebar-collapsed .sidebar-footer .ms-3 {
    display: none !important;
}

.sidebar.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.sidebar-collapsed .nav-link i {
    margin-right: 0;
}

.sidebar.sidebar-collapsed .nav-badge {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: 304px;
    padding: 2rem 3rem;
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 10px 12px;
    border-radius: 999px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    width: fit-content;
    margin-left: auto;
}

.mobile-topbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    min-height: 74px;
    padding: 14px 16px !important;
}

.sidebar.sidebar-collapsed ~ .main-content {
    margin-left: 96px;
}

/* Cards Premium (Lovable Style) */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-xl);
    background: var(--card-bg) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-main);
    position: relative;
    z-index: 1;
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.kpi-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.12) !important;
}
.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--elevate-2) !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl) !important;
    border-color: var(--primary-color) !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.82) !important;
    border: 1px solid rgba(124, 58, 237, 0.12) !important;
    box-shadow: var(--elevate-1) !important;
    backdrop-filter: blur(16px);
}
[data-bs-theme="dark"] .glass-card {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

[data-bs-theme="dark"] .card-header.bg-white {
    background-color: transparent !important;
}

.card-body {
    padding: 24px;
}

/* Page Hero (Help-style) */
.page-hero {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(16px);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}
.page-hero.reveal-visible {
    opacity: 1;
    transform: translateY(0);
    animation: heroCardIn 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-hero::after {
    content: "";
    position: absolute;
    left: -35%;
    bottom: 0;
    width: 34%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.95), rgba(56, 189, 248, 0.95));
    animation: heroShimmerLine 2.9s ease-in-out infinite;
}

.page-hero-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
    animation: heroTitleIn 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    text-wrap: balance;
}

.page-hero-title .page-hero-highlight,
.page-hero-title .page-hero-accent {
    color: #7c3aed;
    font-weight: 800;
    text-shadow: 0 6px 18px rgba(124, 58, 237, 0.24);
}

.page-hero-subtitle {
    color: #64748b;
    margin: 0;
    animation: heroSubtitleIn 0.85s ease both;
    animation-delay: 0.12s;
}

.page-hero .btn {
    animation: heroSubtitleIn 0.95s ease both;
    animation-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
    .page-hero.reveal-visible,
    .page-hero-title,
    .page-hero-subtitle,
    .page-hero .btn,
    .page-hero::after {
        animation: none !important;
    }
}

/* Mobile Stack Layout (dedicated for touch) */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .mobile-stack { padding-left: 0 !important; padding-right: 0 !important; }
    .mobile-stack .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .mobile-stack .page-header .d-flex {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px !important;
    }
    .mobile-stack .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    .mobile-stack .card { border-radius: 18px; }
    .mobile-stack .row.g-4 > [class*="col-"],
    .mobile-stack .row.g-3 > [class*="col-"] {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .mobile-stack .kanban-board {
        display: flex !important;
        flex-direction: column !important;
        overflow-x: visible !important;
    }
    .mobile-stack .kanban-board > [class*="col-"] {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .mobile-stack .kanban-actions,
    .mobile-stack .kanban-filters {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .mobile-stack .kanban-actions .btn,
    .mobile-stack .filter-nav-btn {
        width: 100%;
        justify-content: center;
    }
    .mobile-stack .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px;
    }
    .mobile-stack .nav-pills .nav-link {
        white-space: nowrap;
    }
    .mobile-stack .table-responsive {
        border-radius: 16px;
    }
    .mobile-stack .modal-dialog {
        margin: 1rem auto;
    }
}

/* Mobile-only dashboard layout */
.mobile-only { display: none; }
.desktop-only { display: block; }

.mobile-dashboard {
    display: grid;
    gap: 16px;
}

.mobile-dashboard .mobile-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mobile-dashboard .mobile-hero {
    background: linear-gradient(140deg, rgba(124, 58, 237, 0.14), rgba(37, 99, 235, 0.12));
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.mobile-dashboard .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-dashboard .mobile-header h5 {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}

.mobile-dashboard .mobile-pill {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.2);
    color: #4c1d95;
}

.mobile-dashboard .mobile-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-dashboard .mobile-kpi {
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 12px;
}

.mobile-dashboard .mobile-kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 6px;
}

.mobile-dashboard .mobile-kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.mobile-dashboard .mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mobile-dashboard .mobile-action {
    border-radius: 16px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(37, 99, 235, 0.12));
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #1e293b;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
}

.mobile-dashboard .mobile-action i {
    font-size: 1.35rem;
    color: #7c3aed;
}

.mobile-dashboard .mobile-list {
    display: grid;
    gap: 10px;
}

.mobile-dashboard .mobile-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #f8fafc;
}

.mobile-dashboard .mobile-task-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.92rem;
}

.mobile-dashboard .mobile-task-meta {
    font-size: 0.72rem;
    color: #64748b;
}

.mobile-dashboard .mobile-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
}

/* Buttons Modernos (Pill Shape) */
.btn {
    border-radius: 100px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    letter-spacing: 0.01em;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9, var(--primary-color));
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

/* Botões Light/Dark */
.btn-light {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #a78bfa;
    border-color: #a78bfa;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #a78bfa;
    color: #0f172a;
}

/* Inputs Refinados */
.form-control, .form-select {
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
    border-color: var(--primary-color);
    background-color: #fff;
}

/* Form micro-interactions */
.form-control, .form-select, textarea {
    transition: var(--transition-fast);
}
.form-control:hover, .form-select:hover, textarea:hover {
    border-color: rgba(124, 58, 237, 0.35);
}
.form-control:focus-visible, .form-select:focus-visible, textarea:focus-visible {
    outline: none;
}
.form-control.is-valid, .form-select.is-valid, textarea.is-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}
.form-control.is-invalid, .form-select.is-invalid, textarea.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}
.valid-feedback, .invalid-feedback {
    font-weight: 600;
}

/* Text Colors for Dark Mode */
[data-bs-theme="dark"] .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #0f172a !important;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .sidebar { width: 100%; max-width: 320px; }
    .sidebar-header { padding: 20px 18px; }
    .brand-logo { width: 36px; height: 36px; }
    .brand-name { font-size: 1.2rem; }
    .sidebar-content { padding: 0 12px; }
    .nav-link { padding: 12px 14px; }
    .sidebar-footer { padding: 16px; }
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .mobile-only { display: block; }
    .desktop-only { display: none; }
    .mobile-dashboard .mobile-actions { grid-template-columns: 1fr; }
    .mobile-dashboard .mobile-kpi-grid { grid-template-columns: 1fr; }
}

/* Mobile/Touch Fallback (desktop site on phones) */
@media (max-width: 1200px), (hover: none) and (pointer: coarse) {
    .main-content { margin-left: 0 !important; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar { width: 100%; max-width: 320px; }
}

/* Tablet & Mobile Optimization */
@media (max-width: 1200px) {
    .sidebar { width: 256px; }
    .main-content { margin-left: 256px; padding: 1.5rem 1.75rem; }
    .sidebar.sidebar-collapsed ~ .main-content { margin-left: 96px; }
    .kanban-filters { margin-left: 0 !important; }
    .kpi-row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 1024px) {
    .kpi-card .card-body { padding: 1.25rem !important; }
    .btn, .form-control, .form-select { min-height: 44px; }
    .table-responsive { border-radius: 12px; }
    .kanban-list { min-height: 300px; }
}

@media (max-width: 1199px) {
    .kanban-board > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 1200px) {
    .kanban-board {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 16px;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
    }
    .kanban-board > [class*="col-"] {
        flex: 0 0 340px;
        max-width: 340px;
        scroll-snap-align: start;
    }
}

@media (max-width: 900px) {
    .kanban-board > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .kanban-toolbar { gap: 12px; }
    .kanban-filters {
        margin-left: 0 !important;
        overflow-x: auto;
        padding-bottom: 6px;
        flex-wrap: nowrap !important;
        width: 100%;
    }
    .kanban-filters::-webkit-scrollbar {
        height: 4px;
    }
    .kanban-filters::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.6);
        border-radius: 999px;
    }
    .filter-nav-btn {
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        padding: 0.45rem 0.85rem;
        white-space: nowrap;
        box-shadow: var(--shadow-sm);
    }
    .filter-nav-btn::after {
        display: none;
    }
    .filter-nav-btn:hover, .filter-nav-btn.active {
        background: var(--sidebar-active-bg);
        border-color: rgba(124, 58, 237, 0.25);
    }
    .kanban-actions { width: 100%; justify-content: flex-start; }
    .dashboard-section { margin-bottom: 2rem; }
    .section-header { margin-bottom: 1rem; }
    .kpi-icon-box { width: 44px; height: 44px; font-size: 1.2rem; }
    .kpi-card h2 { font-size: 1.4rem; }
    .kanban-list { min-height: 240px; }
    .kpi-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .main-content { padding: 12px; }
    .kpi-card .card-body { padding: 1rem !important; }
    .filter-nav-btn { font-size: 0.9rem; }
    .filter-nav-btn i { font-size: 1rem; }
}

@media (max-width: 1200px) {
    .table-responsive table {
        min-width: 720px;
    }
}

@media (max-height: 700px) {
    .sidebar-content { padding-bottom: 12px; }
    .sidebar-footer { position: sticky; bottom: 0; }
}

/* Floating Language Button */
.fab-container {
    position: fixed; /* Mantido fixo */
    bottom: 30px;
    right: auto;
    left: 30px; /* Movido para a esquerda para não conflitar com o Pomodoro/Chat */
    z-index: 9999;
    display: none;
    flex-direction: column-reverse;
    align-items: center;
    gap: 15px;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fab-main:hover {
    transform: scale(1.1) rotate(10deg);
    background-color: var(--primary-hover);
}

.fab-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.fab-container:hover .fab-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-item:hover {
    transform: scale(1.1);
}

.fab-item:nth-child(2) { transition-delay: 0.05s; }
.fab-item:nth-child(3) { transition-delay: 0.1s; }
.fab-item:nth-child(4) { transition-delay: 0.15s; }

/* Pomodoro Widget */
.pomodoro-widget {
    position: fixed;
    bottom: 30px;
    right: 110px; /* Posicionado ao lado do Chat (30px + 60px + 20px gap) */
    right: 30px;
    z-index: 9998;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    padding: 8px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(12px);
}

.pomodoro-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.pomodoro-time {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    min-width: 65px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    cursor: pointer; /* Indica que é clicável */
}

.pomodoro-btn {
    background: rgba(124, 58, 237, 0.1);
    border: none;
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pomodoro-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

.pomodoro-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cbd5e1;
}

.pomodoro-status.active { background-color: #10b981; box-shadow: 0 0 10px #10b981; }
.pomodoro-status.paused { background-color: #f59e0b; }

/* Menu de Opções do Pomodoro */
.pomodoro-options {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: none; /* Oculto por padrão */
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
}

.pomodoro-options.show {
    display: flex;
}

.pomodoro-option-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pomodoro-option-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

[data-bs-theme="dark"] .pomodoro-option-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Animações de Entrada */
.fade-in { animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; transform: translateY(20px); }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* Nova animação para texto de destaque (Blur Reveal) */
.text-reveal-blur {
    animation: textBlurReveal 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards;
    opacity: 0;
    filter: blur(12px);
    transform: translateY(15px) scale(0.98);
}
@keyframes textBlurReveal {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

/* --- ESTILOS PARA OS CARDS DA UNLP (REFINADO) --- */
.card-unlp {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card-unlp:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-unlp .card-body {
    padding: 1rem;
    flex-grow: 1; /* Faz o corpo do card crescer */
}

.card-unlp .card-footer {
    padding: 0 1rem 1rem 1rem;
    background-color: transparent;
    border-top: none;
}

.card-unlp .card-title {
    font-size: 1rem;
    min-height: 2.4em; /* Garante altura para 2 linhas */
}

.badge.bg-primary-soft, .badge.bg-success-soft {
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.bg-primary-soft {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.badge.bg-success-soft {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    color: var(--bs-success);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player {
    height: 40px;
    border-radius: 20px;
}

/* --- DASHBOARD HOME (DESIGN MELHORADO) --- */

/* Welcome Banner */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(124, 58, 237, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: translate(30%, -30%);
    border-radius: 50%;
    pointer-events: none;
}

/* Stats Cards Modernos */
.stat-card-modern {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-sm) !important;
    z-index: 2;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary-color) !important;
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-color);
}

.stat-content h3 {
/* Cores dos KPIs (Mais vibrantes) */
.stat-icon-wrapper.green {
    background: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
}

.stat-icon-wrapper.blue {
    background: rgba(54, 185, 204, 0.1);
    color: var(--info-color);
}

    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Gamification / XP Bar */
.xp-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.xp-bar-bg {
    height: 12px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
}

[data-bs-theme="dark"] .xp-bar-bg { background-color: rgba(255,255,255,0.1); }

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #ec4899);
}


/* Kanban Board (Matérias) */
.kanban-col {
    background: #ffffff; /* White Label Clean */
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-col.drag-over {
    background-color: #f8fafc;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

[data-bs-theme="dark"] .kanban-col { background: rgba(30, 41, 59, 0.6); border-color: rgba(255,255,255,0.05); }

.kanban-card {
    background: #ffffff !important;
    border-radius: 10px;
    padding: 0.85rem 1rem; /* Mais compacto */
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.kanban-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--primary-color) !important;
}

.unio-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    margin: 0 0 20px 0;
}

.unio-callout h6 {
    font-weight: 700;
    color: #0f172a;
}

.unio-callout p {
    margin: 0;
    color: #475569;
}

@media (max-width: 768px) {
    .unio-callout {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- ANIMAÇÕES DE FADE-IN (PREMIUM FEEL) --- */
@keyframes fadeInUpPremium {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-section, .stat-card-modern, .xp-container, .kanban-col, .card {
    animation: fadeInUpPremium 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    /* opacity: 0; removido para evitar problemas de visibilidade se a animação falhar */
}

.welcome-section { animation-delay: 0.1s; }
.stat-card-modern:nth-child(1) { animation-delay: 0.2s; }
.stat-card-modern:nth-child(2) { animation-delay: 0.3s; }
.stat-card-modern:nth-child(3) { animation-delay: 0.4s; }
.xp-container { animation-delay: 0.5s; }
.kanban-col { animation-delay: 0.6s; }

/* --- PREMIUM TABS & FILTERS (Todos, Minhas Matérias, UNLP) --- */
.nav-pills-premium {
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 100px;
    display: inline-flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.nav-pills-premium .nav-link {
    border-radius: 100px;
    padding: 0.6rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.nav-pills-premium .nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.6);
}

.nav-pills-premium .nav-link.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

/* --- KPI CARDS (HOME) --- */
.kpi-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 14px;
    transition: var(--transition-fast);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06) !important;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: #f8fafc;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

/* Quick Actions (Minimal Shortcuts) */
.quick-actions {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    flex-wrap: wrap;
}
.btn-icon-soft {
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-icon-soft span {
    white-space: nowrap;
}
.btn-icon-soft:hover {
    transform: translateY(-1px);
    color: var(--primary-color);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: var(--shadow-md);
}

/* Quick Tabs (Dashboard shortcuts) */
.quick-tabs {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    padding-bottom: 6px;
}
.dashboard-section .page-header {
    margin-bottom: 1.3rem;
}
.content-section .content-grid {
    margin-top: 1rem;
}
.quick-tabs-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #38bdf8);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.35);
    transform: translateX(0);
}
.quick-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}
.quick-tab i {
    font-size: 0.95rem;
}
.quick-tab:hover {
    color: var(--text-main);
}
.quick-tab.active {
    color: var(--primary-color);
    border-color: transparent;
    background: transparent;
}

.tab-count {
    margin-left: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 700;
}

.quick-tab.active .tab-count {
    background: rgba(124, 58, 237, 0.12);
    color: var(--primary-color);
}

/* SaaS visual upgrade (Home only) */
.dashboard-saas .page-header .welcome-hero {
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-radius: 16px;
    padding: 12px 14px;
    background:
        radial-gradient(130% 100% at 0% 0%, rgba(124, 58, 237, 0.10), transparent 42%),
        radial-gradient(110% 90% at 100% 0%, rgba(56, 189, 248, 0.08), transparent 46%),
        rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.dashboard-saas .page-header .welcome-brand-icon {
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.28);
}

.dashboard-saas .page-header .welcome-title {
    font-size: clamp(1.1rem, 0.95rem + 0.9vw, 1.65rem);
}

.dashboard-saas .page-header .page-subtitle {
    color: #64748b !important;
}

.dashboard-saas .page-actions .quick-actions {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.dashboard-saas .page-actions .btn-icon-soft {
    min-height: 36px;
}

.dashboard-saas .saas-hero-card {
    position: relative;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 18px;
    padding: 14px 16px;
    background:
        radial-gradient(160% 120% at 0% 0%, rgba(124, 58, 237, 0.13), transparent 45%),
        radial-gradient(120% 90% at 100% 0%, rgba(56, 189, 248, 0.12), transparent 48%),
        rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}

.dashboard-saas .saas-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b21b6;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.24);
    border-radius: 999px;
    padding: 5px 10px;
    width: fit-content;
    margin-bottom: 10px;
}

.dashboard-saas .saas-actions {
    gap: 10px;
}

.dashboard-saas .btn-icon-soft-primary {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 60%, #8b5cf6 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.32);
}

.dashboard-saas .btn-icon-soft-primary:hover {
    color: #ffffff;
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.dashboard-saas .saas-kpi {
    position: relative;
    overflow: hidden;
}

.dashboard-saas .saas-kpi::after {
    content: "";
    position: absolute;
    inset: auto -30px -36px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.2;
    pointer-events: none;
}

.dashboard-saas .saas-kpi-violet::after {
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

.dashboard-saas .saas-kpi-cyan::after {
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
}

.dashboard-saas .saas-kpi-amber::after {
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
}

.dashboard-saas .saas-progress-card {
    border-color: rgba(37, 99, 235, 0.18) !important;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(37, 99, 235, 0.10), transparent 52%),
        #ffffff !important;
}

.dashboard-saas .saas-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 10px;
}

.dashboard-saas .saas-section-title {
    font-size: 1.03rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.dashboard-saas .saas-section-sub {
    font-size: 0.82rem;
    color: #64748b;
}

/* Shared SaaS shells (all dashboard pages) */
.dashboard-saas .saas-page-shell {
    max-width: 1240px;
    margin: 0 auto;
}

.dashboard-saas .saas-panel {
    border: 1px solid rgba(124, 58, 237, 0.12) !important;
    border-radius: 18px !important;
    background:
        radial-gradient(120% 100% at 100% 0%, rgba(124, 58, 237, 0.08), transparent 54%),
        radial-gradient(120% 90% at 0% 0%, rgba(56, 189, 248, 0.07), transparent 52%),
        rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.dashboard-saas .saas-filter-panel {
    border-color: rgba(148, 163, 184, 0.24) !important;
}

.dashboard-saas .saas-item-card {
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.dashboard-saas .saas-item-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.26) !important;
    box-shadow: 0 18px 32px rgba(124, 58, 237, 0.16);
}

.dashboard-saas .saas-empty {
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .dashboard-saas .page-header .welcome-hero {
        width: 100%;
        padding: 10px 10px;
        border-radius: 14px;
    }
    .dashboard-saas .page-actions .quick-actions {
        width: 100%;
    }
    .dashboard-saas .saas-hero-card {
        padding: 12px 12px;
        border-radius: 16px;
    }
    .dashboard-saas .saas-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .dashboard-saas .saas-page-shell {
        max-width: 100%;
    }
}

/* Entry animations */
.kpi-row > [class*="col-"],
.content-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.reveal-visible .kpi-row > [class*="col-"],
.reveal-visible .content-card,
.content-card.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dashboard home layout */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 1rem;
}
.page-title {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}
.page-subtitle {
    margin: 0.2rem 0 0 0;
    font-size: 0.9rem;
}
.welcome-title {
    animation: welcomeFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.welcome-subtitle {
    animation: welcomeFadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: 0.08s;
}
@keyframes welcomeFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .welcome-title,
    .welcome-subtitle {
        animation: none !important;
    }
}

/* Welcome hero reveal (inside-out) */
.welcome-hero {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.welcome-brand-line {
    display: flex;
    align-items: center;
    gap: 12px;
}
.welcome-brand-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: 1px solid rgba(124, 58, 237, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    animation: welcomePop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.welcome-reveal {
    display: inline-block;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    animation: welcomeReveal 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: 0.2s;
}
.welcome-reveal-sub {
    animation-delay: 0.35s;
}
.welcome-reveal .welcome-title,
.welcome-reveal .welcome-subtitle {
    transform: translateX(-12px);
    animation: welcomeSlide 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: 0.2s;
}
.welcome-reveal-sub .welcome-subtitle {
    animation-delay: 0.35s;
}

@keyframes welcomeReveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}
@keyframes welcomeSlide {
    from { transform: translateX(-14px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes welcomePop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

[data-bs-theme="dark"] .welcome-brand-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: rgba(124, 58, 237, 0.7);
    color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .welcome-brand-icon,
    .welcome-reveal,
    .welcome-reveal .welcome-title,
    .welcome-reveal .welcome-subtitle {
        animation: none !important;
        clip-path: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.content-section {
    margin-top: 1rem;
}
.content-grid {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}
.content-grid .simple-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}
.content-grid .modern-card {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    background: #ffffff;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.content-grid .modern-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #38bdf8);
    opacity: 0.75;
}
.content-grid .modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    border-color: rgba(124, 58, 237, 0.25);
}
.content-card[data-type="materia"] .modern-card {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0) 45%),
        #ffffff;
    border-color: rgba(124, 58, 237, 0.16);
}
.content-card[data-type="materia"] .modern-card::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -36px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, rgba(124, 58, 237, 0) 68%);
    pointer-events: none;
}
.content-card[data-type="materia"] .modern-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 20px 40px rgba(76, 29, 149, 0.18);
}
.content-card[data-type="materia"] .card-title {
    font-size: 1.08rem;
}
.content-card[data-type="materia"] .card-footer .btn {
    min-width: 108px;
}
.content-card[data-type="materia"][data-status="pending"] .card-footer .btn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border: 0;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
}
.content-card[data-type="materia"][data-status="pending"] .card-footer .btn:hover {
    filter: brightness(1.03);
}
.content-card[data-type="materia"][data-status="progress"] .card-footer .btn {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border: 0;
    color: #ffffff;
    box-shadow: 0 9px 20px rgba(124, 58, 237, 0.28);
}
.content-card[data-type="materia"][data-status="progress"] .card-footer .btn:hover {
    filter: brightness(1.04);
}
.content-card[data-type="materia"][data-status="completed"] .card-footer .btn {
    border-color: rgba(16, 185, 129, 0.45);
    color: #047857;
    background: rgba(16, 185, 129, 0.08);
}
.content-card[data-type="materia"][data-status="completed"] .card-footer .btn:hover {
    background: rgba(16, 185, 129, 0.14);
}
.content-card[data-type="materia"][data-status="pending"] .modern-card::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}
.content-card[data-type="materia"][data-status="progress"] .modern-card::before {
    background: linear-gradient(90deg, #7c3aed, #38bdf8);
}
.content-card[data-type="materia"][data-status="completed"] .modern-card::before {
    background: linear-gradient(90deg, #10b981, #22c55e);
}
.content-grid .modern-card .card-header {
    background: transparent;
    border-bottom: none;
    padding: 12px 14px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.content-grid .modern-card .card-body {
    padding: 10px 14px 12px 14px;
}
.content-grid .modern-card .card-footer {
    padding: 0 14px 14px 14px;
}
.content-grid .card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.content-card {
    display: flex;
}
.content-card > .card {
    width: 100%;
}
.card-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.card-meta {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #64748b !important;
}
.card-actions {
    margin-top: 6px;
}
.card-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.card-status-pending {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.35);
}
.card-status-progress {
    background: rgba(124, 58, 237, 0.12);
    color: #5b21b6;
    border-color: rgba(124, 58, 237, 0.32);
}
.card-status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.32);
}
.card-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
    font-size: 1rem;
}
.content-card[data-type="materia"] .card-type-icon {
    background: rgba(124, 58, 237, 0.14);
    color: #6d28d9;
}
.content-grid .modern-card .btn {
    font-weight: 700;
    letter-spacing: 0.01em;
    padding-left: 14px;
    padding-right: 14px;
}
.content-grid .modern-card .btn:hover {
    transform: translateY(-1px);
}
.content-card.hidden {
    display: none;
}

.empty-state {
    margin-top: 1.5rem;
    padding: 2rem;
    border-radius: 14px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.empty-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 1.1rem;
}
.empty-title {
    font-weight: 700;
    color: #0f172a;
}
.empty-text {
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 576px) {
    .quick-tabs {
        gap: 8px;
    }
    .quick-tab {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    .content-grid {
        gap: 12px;
    }
    .content-section .content-grid {
        margin-top: 0.85rem;
    }
}

/* Sidebar dark mode toggle (pill) */
.theme-toggle-pill {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 999px;
}
.theme-toggle-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}
.theme-toggle-track {
    position: relative;
    height: 22px;
    width: 48px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
    transition: background 0.25s ease;
}
.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.45);
    transition: transform 0.25s ease;
}

/* Light theme state */
[data-bs-theme="light"] .theme-toggle-icon {
    background: #ffffff;
}
[data-bs-theme="light"] .theme-toggle-track {
    background: #ffffff;
}
[data-bs-theme="light"] .theme-toggle-knob {
    transform: translateX(22px);
}

/* Dark theme state */
[data-bs-theme="dark"] .theme-toggle-icon {
    background: #ffffff;
    color: #0f172a;
}
[data-bs-theme="dark"] .theme-toggle-track {
    background: #ffffff;
}
[data-bs-theme="dark"] .theme-toggle-knob {
    transform: translateX(2px);
}

/* Remove stray bullets globally in dashboard content */
.main-content ul,
.main-content ol {
    list-style: none;
    padding-left: 0;
}

.main-content li::marker {
    content: "";
}

/* Safety: remove stray bullets/markers near quick tabs */
.quick-tabs,
.quick-tabs * {
    list-style: none;
}
.quick-tab::before,
.quick-tab::after {
    display: none !important;
    content: none !important;
}

/* Filter Navigation (Premium Style - Home) */
.filter-nav-btn {
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0.5rem;
    position: relative;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-nav-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.filter-nav-btn:hover, .filter-nav-btn.active {
    color: var(--primary-color);
}

.filter-nav-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.filter-nav-btn:hover::after, .filter-nav-btn.active::after {
    width: 100%;
}

.filter-nav-btn:hover i {
    transform: translateY(-2px);
}

/* KPI Progress */
.kpi-progress-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(56, 189, 248, 0.06)) !important;
}
.kpi-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.kpi-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), #38bdf8);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
    transition: width 0.6s ease;
}
.kpi-progress-meta {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.kpi-progress-foot {
    letter-spacing: 0.02em;
}

/* UNLP cards */
.unlp-card .unlp-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.unlp-card .unlp-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #38bdf8);
    box-shadow: 0 6px 14px rgba(56, 189, 248, 0.22);
}
[data-bs-theme="dark"] .unlp-card .unlp-progress-bar {
    background: rgba(148, 163, 184, 0.2);
}

/* Dark mode fixes for home */
[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .content-grid .modern-card,
[data-bs-theme="dark"] .content-grid .simple-card {
    background: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.5) !important;
}
[data-bs-theme="dark"] .content-card[data-type="materia"] .modern-card {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(124, 58, 237, 0.18), rgba(124, 58, 237, 0) 46%),
        #1e293b !important;
    border-color: rgba(124, 58, 237, 0.32) !important;
}
[data-bs-theme="dark"] .content-card[data-type="materia"] .modern-card::after {
    background: radial-gradient(circle, rgba(167, 139, 250, 0.26) 0%, rgba(167, 139, 250, 0) 70%);
}
[data-bs-theme="dark"] .content-card[data-type="materia"] .modern-card:hover {
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.58);
}
[data-bs-theme="dark"] .content-card[data-type="materia"][data-status="pending"] .card-footer .btn {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
}
[data-bs-theme="dark"] .content-card[data-type="materia"][data-status="progress"] .card-footer .btn {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: #fff;
}
[data-bs-theme="dark"] .content-card[data-type="materia"][data-status="completed"] .card-footer .btn {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.4);
    color: #86efac;
}
[data-bs-theme="dark"] .card-title {
    color: #f8fafc;
}
[data-bs-theme="dark"] .card-meta {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .card-type-icon {
    background: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .content-card[data-type="materia"] .card-type-icon {
    background: rgba(124, 58, 237, 0.3);
    color: #ddd6fe;
}
[data-bs-theme="dark"] .card-status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}
[data-bs-theme="dark"] .card-status-progress {
    background: rgba(124, 58, 237, 0.24);
    color: #c4b5fd;
    border-color: rgba(124, 58, 237, 0.4);
}
[data-bs-theme="dark"] .card-status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}
[data-bs-theme="dark"] .kpi-icon {
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0 !important;
    border-color: rgba(148, 163, 184, 0.2);
}
[data-bs-theme="dark"] .page-title {
    color: #f8fafc;
}
[data-bs-theme="dark"] .quick-actions {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}
[data-bs-theme="dark"] .btn-icon-soft {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
}
[data-bs-theme="dark"] .quick-tab {
    color: #cbd5f5;
}
[data-bs-theme="dark"] .tab-count {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .empty-state {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}
[data-bs-theme="dark"] .empty-icon {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .kpi-progress-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(56, 189, 248, 0.12)) !important;
}
[data-bs-theme="dark"] .kpi-progress-bar {
    background: rgba(148, 163, 184, 0.2);
}
[data-bs-theme="dark"] .badge.bg-primary-subtle {
    background: rgba(124, 58, 237, 0.2) !important;
    color: #c4b5fd !important;
}
[data-bs-theme="dark"] .badge.bg-success-subtle {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
}
[data-bs-theme="dark"] .badge.bg-info-subtle {
    background: rgba(56, 189, 248, 0.2) !important;
    color: #bae6fd !important;
}

/* --- CHATBOT UI PREMIUM (UNIO) --- */
.chat-container {
    height: calc(100vh - 130px);
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    z-index: 10;
}

.chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 85%;
    animation: fadeInUpPremium 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
}

.message.user .message-avatar {
    background: #e2e8f0;
    color: var(--text-muted);
}

.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.message.bot .message-bubble {
    background: white;
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
    color: var(--text-main);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.chat-input-area {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.chat-input-wrapper {
    background: #f1f5f9;
    border-radius: 24px;
    padding: 0.5rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.chat-input-wrapper:focus-within {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

/* --- UNIO CHAT WIDGET (FLOATING) --- */
.unio-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unio-fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.unio-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.unio-chat-widget.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.unio-chat-header {
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.unio-avatar-sm {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-chat {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-close-chat:hover { color: white; }

.unio-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    font-size: 0.9rem;
}

.chat-message.bot { align-self: flex-start; }
.chat-message.user { align-self: flex-end; align-items: flex-end; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background: white;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 2px;
    color: var(--text-main);
}

.chat-message.user .chat-bubble {
    background: var(--primary-color);
    color: white;
    border-top-right-radius: 2px;
}

.unio-chat-footer {
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

/* Botões de Comando do Chat */
.unio-command-btn {
    font-size: 0.75rem;
    transition: all 0.2s;
    background: white;
    color: var(--primary-color);
    border-color: rgba(124, 58, 237, 0.2) !important;
}
.unio-command-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color) !important;
}
