* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #F8FAFC;
    overflow-x: hidden;
}

.dark body,
body.dark-mode {
    background: #0F172A;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Sidebar */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar.collapsed .sidebar-category {
    display: none;
}

.sidebar.collapsed .sidebar-logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-item i {
    margin-right: 0;
}

.sidebar.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-bottom {
    padding: 0.5rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-bottom-text {
    display: none;
}

/* Tooltip */
.tooltip-wrapper {
    position: relative;
}

.tooltip-wrapper .tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: #1E293B;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip-wrapper .tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1E293B;
}

.sidebar.collapsed .tooltip-wrapper:hover .tooltip {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Main content offset */
.main-content {
    margin-left: 256px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

/* Dropdown animation */
.dropdown-menu {
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Card hover */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Animated counter */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Progress bar animation */
.progress-bar-fill {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Notification badge pulse */
@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.badge-pulse {
    animation: pulse-badge 2s infinite;
}

/* Active sidebar item */
.sidebar-item.active {
    background: #EEF2FF;
    color: #6366F1;
}

.dark .sidebar-item.active {
    background: #312E81;
    color: #A5B4FC;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 50;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.8);
}

/* Dark mode styles */
.dark-mode {
    background: #0F172A;
    color: #E2E8F0;
}

.dark-mode .card-bg {
    background: #1E293B;
    border-color: #334155;
}

.dark-mode .text-slate-900,
.dark-mode .text-gray-900 {
    color: #F1F5F9;
}

.dark-mode .text-slate-600,
.dark-mode .text-gray-600 {
    color: #94A3B8;
}

.dark-mode .text-slate-500,
.dark-mode .text-gray-500 {
    color: #94A3B8;
}

.dark-mode .text-slate-700,
.dark-mode .text-gray-700 {
    color: #CBD5E1;
}

.dark-mode .text-slate-800 {
    color: #E2E8F0;
}

.dark-mode .bg-white {
    background: #1E293B;
}

.dark-mode .bg-slate-50,
.dark-mode .bg-gray-50 {
    background: #0F172A;
}

.dark-mode .border-slate-200,
.dark-mode .border-gray-200 {
    border-color: #334155;
}

.dark-mode .border-slate-100,
.dark-mode .border-gray-100 {
    border-color: #334155;
}

.dark-mode .glass {
    background: rgba(30, 41, 59, 0.8);
}

.dark-mode .sidebar-bg {
    background: #1E293B;
    border-color: #334155;
}

.dark-mode .sidebar-item:not(.active):hover {
    background: #334155;
}

.dark-mode .sidebar-item.active {
    background: #312E81;
    color: #A5B4FC;
}

.dark-mode input,
.dark-mode select {
    background: #0F172A;
    border-color: #334155;
    color: #E2E8F0;
}

.dark-mode .dropdown-bg {
    background: #1E293B;
    border-color: #334155;
}

/* Timeline dot */
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.timeline-line {
    position: absolute;
    left: 5px;
    top: 12px;
    bottom: 0;
    width: 2px;
    background: #E5E7EB;
    z-index: 1;
}

.dark-mode .timeline-line {
    background: #334155;
}

/* Tab styles */
.tab-btn {
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #6366F1;
    border-color: #6366F1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}