:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #10b981;
    --secondary-hover: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --light: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item:hover, .menu-item.active {
    color: white;
    background-color: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary);
}

.menu-item i {
    font-size: 1.2rem;
    width: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.stat-card:hover {
    transform: scale(1.02);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Tables (Excel Style) */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover {
    background-color: #f1f5f9;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active, .status-completed { background: #dcfce7; color: #166534; }
.status-inactive, .status-pending { background: #fee2e2; color: #991b1b; }
.status-late { background: #fef3c7; color: #92400e; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Status Badge Overrides */
.status-badge {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Table Enhancements */
.table-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
}

/* Login specific (if needed globally) */
.login-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* Responsive Design Enhancements */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .sidebar-logo { font-size: 1.2rem; }
    .sidebar-header h1, .menu-item span { display: none; }
    .main-content { margin-left: 80px; }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: fadeInUp 0.3s ease-out;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        margin: 10% auto;
    }
}
    :root { --sidebar-width: 280px; }
    
    .sidebar { 
        transform: translateX(-100%); 
        width: var(--sidebar-width);
    }
    
    .sidebar.show { 
        transform: translateX(0); 
    }
    
    .sidebar-header h1, .menu-item span { display: block; }
    
    .main-content { 
        margin-left: 0; 
        padding: 1rem;
    }
    
    .top-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .grid-2 {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info p {
        font-size: 1.2rem;
    }

    .card {
        padding: 1rem;
    }

    .mobile-toggle {
        display: block !important;
        background: var(--dark);
        color: white;
        padding: 0.5rem;
        border-radius: 8px;
        cursor: pointer;
        margin-right: 1rem;
    }
}

.mobile-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar.show + .sidebar-overlay {
    display: block;
}

.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--secondary); }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
