* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0e1a;
    color: #e0e6f0;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
}
.sidebar .navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.5);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    margin: 0 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
}
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(123,47,247,0.15));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.sidebar .nav-link i { margin-right: 8px; font-size: 1.1rem; }
.beta-badge {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7) !important;
    color: #fff !important;
    font-size: 0.6rem;
    vertical-align: super;
    border: none;
}
.user-info small { color: rgba(255,255,255,0.5) !important; }

.main-content {
    margin-left: 0;
    min-height: calc(100vh - 60px);
    padding: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0e1a;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(0,212,255,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(123,47,247,0.08) 0%, transparent 50%);
    animation: loginGlow 10s ease-in-out infinite alternate;
}
@keyframes loginGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -1%) rotate(3deg); }
}
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}
.login-card {
    background: linear-gradient(135deg, rgba(22,27,34,0.95), rgba(13,17,23,0.95));
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 25px 80px rgba(0,0,0,0.5), 0 0 40px rgba(0,212,255,0.03);
    backdrop-filter: blur(20px);
}
.login-header {
    padding: 40px 30px 30px;
    text-align: center;
}
.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(123,47,247,0.15));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.login-logo i {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-title {
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: 3px;
    margin: 0;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-subtitle { color: rgba(255,255,255,0.35); font-size: 0.9rem; margin-top: 6px; }
.login-body { padding: 10px 30px 20px; }
.login-footer { padding: 20px 30px 30px; }
.login-btn {
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border: none;
    transition: all 0.3s;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,212,255,0.25);
}
.login-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.feature-item {
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.feature-item i {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1rem;
}

.stat-card {
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(22,27,34,0.8), rgba(13,17,23,0.8)) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0,212,255,0.2) !important;
    box-shadow: 0 8px 30px rgba(0,212,255,0.05);
}
.stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.stat-change { font-size: 0.78rem; margin-top: 4px; }

.card {
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(22,27,34,0.9), rgba(13,17,23,0.9)) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(10px);
}
.card-header {
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    padding: 1.1rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 16px 16px 0 0 !important;
    background: transparent !important;
    color: rgba(255,255,255,0.8);
}
.card-header .fw-bold { color: #e0e6f0; }
.card-body { color: #c0c8d4; }

.task-item {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s;
    border-radius: 8px;
}
.task-item:hover {
    background: rgba(255,255,255,0.03);
    padding-left: 18px;
}
.task-item:last-child { border-bottom: none; }

.task-card {
    transition: all 0.3s;
    background: linear-gradient(135deg, rgba(22,27,34,0.8), rgba(13,17,23,0.8)) !important;
    border: 1px solid rgba(255,255,255,0.04) !important;
}
.task-card:hover {
    transform: translateX(4px);
    border-color: rgba(0,212,255,0.15) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.6rem 1rem;
    background: rgba(255,255,255,0.04);
    color: #e0e6f0;
    transition: all 0.3s;
}
.form-control:focus, .form-select:focus {
    border-color: #00d4ff;
    background: rgba(0,212,255,0.04);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
    color: #fff;
}
.form-control::placeholder { color: rgba(255,255,255,0.2); }
.form-label { color: rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 500; }
.input-group-text {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    border-radius: 10px 0 0 10px;
}

.modal-content {
    border-radius: 16px;
    background: linear-gradient(135deg, #1a1f2e, #0d1117) !important;
    border: 1px solid rgba(255,255,255,0.08);
}
.modal-header {
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(123,47,247,0.1));
}
.modal-header .modal-title { color: #fff; }

.table {
    color: #c0c8d4;
    margin-bottom: 0;
}
.table th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    padding: 0.8rem 0.5rem;
}
.table td {
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding: 0.7rem 0.5rem;
    color: #c0c8d4;
}
.table-hover tbody tr:hover {
    background: rgba(0,212,255,0.03);
}
.table-light {
    background: rgba(255,255,255,0.03) !important;
}
.table-light th { color: rgba(255,255,255,0.5) !important; }

.btn-outline-primary {
    border-color: rgba(0,212,255,0.3);
    color: #00d4ff;
}
.btn-outline-primary:hover {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border-color: transparent;
    color: #fff;
}
.btn-outline-light {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.btn-outline-secondary {
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}
.btn-outline-secondary:hover, .btn-outline-secondary.active {
    background: rgba(0,212,255,0.1);
    border-color: rgba(0,212,255,0.3);
    color: #00d4ff;
}
.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border: none;
}
.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(0,212,255,0.2);
    transform: translateY(-1px);
}

.btn-group .btn { border-radius: 8px !important; margin: 0 2px; }
.btn-group-sm .btn { font-size: 0.78rem; }

.text-secondary { color: rgba(255,255,255,0.35) !important; }
.text-primary { color: #00d4ff !important; }
.text-success { color: #00e676 !important; }
.text-warning { color: #ffab00 !important; }
.text-danger { color: #ff5252 !important; }
.text-info { color: #00d4ff !important; }

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.bg-primary { background: linear-gradient(135deg, #00d4ff, #0099cc) !important; }
.bg-success { background: linear-gradient(135deg, #00e676, #00c853) !important; }
.bg-warning { background: linear-gradient(135deg, #ffab00, #ff8f00) !important; }
.bg-danger { background: linear-gradient(135deg, #ff5252, #d50000) !important; }
.bg-info { background: linear-gradient(135deg, #00d4ff, #0099cc) !important; }
.bg-secondary { background: rgba(255,255,255,0.1) !important; color: rgba(255,255,255,0.6) !important; }
.bg-dark { background: rgba(255,255,255,0.05) !important; }

.progress {
    border-radius: 10px;
    background-color: rgba(255,255,255,0.05);
}
.progress-bar {
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
}

.alert {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(22,27,34,0.9);
    backdrop-filter: blur(10px);
    color: #e0e6f0;
}
.alert-danger {
    background: rgba(255,82,82,0.1);
    border-color: rgba(255,82,82,0.2);
    color: #ff8a80;
}
.alert-success {
    background: rgba(0,230,118,0.1);
    border-color: rgba(0,230,118,0.2);
    color: #69f0ae;
}

.bg-light {
    background: rgba(255,255,255,0.03) !important;
}
.bg-opacity-10 { background: rgba(255,255,255,0.05) !important; }

.list-group-item {
    background: transparent;
    border-color: rgba(255,255,255,0.06);
    color: #c0c8d4;
}

.modal-backdrop { background: rgba(0,0,0,0.7); }

.toast {
    background: linear-gradient(135deg, #1a1f2e, #0d1117) !important;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #e0e6f0;
}
.toast-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.chart-container {
    position: relative;
}

#aiModalBody .bg-light {
    background: rgba(255,255,255,0.04) !important;
}

@media (max-width: 768px) {
    .stat-value { font-size: 1.2rem; }
    .container-fluid { padding: 0.75rem; }
    .login-container { padding: 10px; }
}

.brand-text {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.text-dark { color: #e0e6f0 !important; }

select.form-select option {
    background: #1a1f2e;
    color: #e0e6f0;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.1);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ─── DROPDOWN NAV ────────────────────────────────────────────────────── */
.dropdown-menu-dark {
    background: #111827 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    padding: 6px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
.dropdown-menu-dark .dropdown-item {
    color: rgba(255,255,255,0.6) !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease;
}
.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(0,212,255,0.1) !important;
    color: #00d4ff !important;
}
.dropdown-menu-dark .dropdown-item.active {
    background: rgba(0,212,255,0.15) !important;
    color: #00d4ff !important;
}
.navbar .dropdown-toggle::after {
    vertical-align: middle;
    opacity: 0.5;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-menu.show {
    animation: fadeInUp 0.2s ease;
}

/* ─── CUSTOM SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── PRINT STYLES ──────────────────────────────────────────────────────── */
@media print {
    .sidebar, .btn, .navbar-toggler, .user-info, .dropdown, footer {
        display: none !important;
    }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    body { background: white !important; color: black !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; background: white !important; }
    .card-body, .card-header { background: white !important; color: black !important; }
    .table { color: black !important; }
    .table-dark { background: white !important; }
    .table-dark th, .table-dark td { color: black !important; border-color: #ddd !important; }
}

@media (max-width: 991px) {
    .sidebar .navbar-collapse {
        background: rgba(13,17,23,0.98);
        border-radius: 16px;
        padding: 12px;
        margin-top: 10px;
        border: 1px solid rgba(255,255,255,0.06);
        backdrop-filter: blur(20px);
    }
    .sidebar .navbar-nav {
        gap: 4px;
    }
    .sidebar .nav-link {
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 0.95rem;
    }
    .sidebar .d-flex.align-items-center {
        padding: 12px 14px;
        margin-top: 8px;
        background: rgba(255,255,255,0.03);
        border-radius: 10px;
    }
    .user-info { text-align: left !important; }
}

@media (max-width: 767px) {
    .container-fluid { padding: 0.5rem; }
    .stat-value { font-size: 1.1rem; }
    .stat-card .card-body { padding: 0.8rem; }
    .card-body { padding: 0.8rem; }
    .card-header { padding: 0.8rem 1rem; }
    
    .row.g-3 > [class*="col-"] { padding: 0 4px; }
    .row.g-3 { margin: 0 -4px; }
    
    h2.fw-bold { font-size: 1.2rem; }
    h2.fw-bold i { font-size: 1.3rem; }
    
    .table { font-size: 0.78rem; }
    .table th, .table td { padding: 0.5rem 0.3rem; }
    .table-responsive { margin: 0; }
    
    .btn-group { flex-wrap: wrap; }
    .btn-group .btn { font-size: 0.75rem; padding: 0.3rem 0.6rem; margin: 1px; }
    
    .main-content { padding: 0; }
    .login-page { padding: 12px; }
    .login-container { padding: 0; }
    .login-card { border-radius: 20px; }
    .login-header { padding: 30px 20px 20px; }
    .login-body { padding: 10px 20px 15px; }
    .login-footer { padding: 15px 20px 20px; }
    .login-title { font-size: 1.7rem; }
    .login-logo { width: 60px; height: 60px; }
    .login-logo i { font-size: 2rem; }
    .login-features { gap: 12px; }
    .feature-item { font-size: 0.7rem; }
    .feature-item i { font-size: 0.85rem; }
    
    .card { border-radius: 12px; }
    .stat-card { border-radius: 12px; }
    
    canvas { max-height: 200px !important; }
    #revenueChart, #categoryChart, #funnelChart, #forecastChart,
    #monthlyChart, #productBreakdownChart, #financeChart,
    #expenseChart, #managerChart { max-height: 200px !important; }
    
    .modal-dialog { margin: 10px; }
    .modal-body { padding: 16px; }
    
    .task-item { padding: 10px 8px; }
    .task-item h6 { font-size: 0.85rem; }
    .task-item .text-secondary.small { font-size: 0.7rem; }
    
    .timeline { padding-left: 25px; }
    .timeline::before { left: 10px; }
    .timeline-marker { left: -23px; width: 12px; height: 12px; }
    .timeline-content { padding: 12px; }
    
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child {
        width: 100%;
    }
    .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        width: 100%;
        margin: 2px 0;
    }
    
    .btn-outline-primary.me-2 { margin-right: 0 !important; }
    
    .card-header .d-flex { flex-direction: column; gap: 8px; }
    .card-header .d-flex .btn-group { width: 100%; }
    .card-header .d-flex .btn-group .btn { flex: 1; }
    .card-header .d-flex a, .card-header .d-flex select { width: 100%; }
    
    #topProducts .d-flex { flex-wrap: wrap; }
    #topProducts .d-flex .text-end { min-width: auto !important; }
    #topProducts .d-flex .flex-grow-1 { min-width: 100px; }
    
    #managerKpiContainer .row.g-2 > [class*="col-"] { padding: 0 4px; }
    #managerKpiContainer .card-body { padding: 0.6rem; }
    #managerKpiContainer .d-flex { flex-direction: column; }
    
    .table-responsive { overflow-x: auto; }
    
    .progress { height: 4px !important; }
    
    .task-card .d-flex { flex-direction: column; gap: 8px; }
    .task-card .ms-3 { margin-left: 0 !important; width: 100%; }
    .task-card .ms-3 form { width: 100%; }
    .task-card select { width: 100%; }
    
    .tasks-container .card-body .d-flex { flex-direction: column; }
    .tasks-container .ms-3 { margin-left: 0 !important; width: 100%; margin-top: 8px; }
    .tasks-container select.form-select-sm { width: 100%; }
    
    .navbar-brand { font-size: 1.1rem; }
    .navbar-brand i { font-size: 1.5rem !important; }
}

@media (max-width: 575px) {
    .row.g-3 > [class*="col-"] {
        padding: 0 2px;
    }
    .row.g-3 { margin: 0 -2px; }
    .stat-label { font-size: 0.62rem; }
    .stat-value { font-size: 0.95rem; }
    .stat-change { font-size: 0.65rem; }
    
    .badge { font-size: 0.6rem; padding: 0.2em 0.5em; }
    .btn-sm { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
    
    canvas { max-height: 160px !important; }
    #revenueChart, #categoryChart, #funnelChart, #forecastChart,
    #monthlyChart, #productBreakdownChart, #financeChart,
    #expenseChart, #managerChart { max-height: 160px !important; }
    
    .login-title { font-size: 1.4rem; }
    .login-subtitle { font-size: 0.75rem; }
    .login-card { border-radius: 16px; }
    .login-header { padding: 24px 16px 16px; }
    .login-body { padding: 8px 16px 12px; }
    .login-footer { padding: 12px 16px 16px; }
}
