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

:root {
    --primary: #4F46E5; /* Indigo */
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #10B981; /* Emerald */
    --accent: #F43F5E; /* Rose */
    
    --bg-main: #F3F4F6;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #111827; /* Dark Gray for Sidebar */
    
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --text-sidebar: #9CA3AF;
    --text-sidebar-hover: #FFFFFF;
    
    --border-light: #E5E7EB;
    --border-sidebar: #1F2937;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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-glow: 0 0 15px rgba(79, 70, 229, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--text-muted); }

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

.animate-fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Dashboard Layout */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 50;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(79,70,229,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(16,185,129,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.sidebar-brand h2 {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 0;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.menu-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid transparent;
    position: relative;
}

.nav-item i {
    font-size: 1.15rem;
    transition: all 0.25s ease;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    transform: none;
    border-color: rgba(255,255,255,0.04);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(139,92,246,0.12) 100%);
    color: #c7d2fe;
    border-left: none;
    border-color: rgba(99,102,241,0.2);
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
}

.nav-item.active i {
    color: #a5b4fc;
}

/* Submenu styling */
.submenu {
    margin-left: 0.5rem;
    border-left: 2px solid rgba(99,102,241,0.2);
    padding-left: 0.25rem;
}

.submenu .nav-item {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    margin-bottom: 1px;
    color: #64748b;
}

.submenu .nav-item:hover {
    color: #cbd5e1;
    background: rgba(255,255,255,0.04);
}

.submenu .nav-item.active {
    color: #a5b4fc;
    background: rgba(99,102,241,0.1);
    border-color: transparent;
    box-shadow: none;
}

.submenu .nav-item i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Top Header */
.top-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-main);
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.icon-btn .badge {
    position: absolute;
    top: 0px;
    right: 2px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.user-profile:hover {
    background: var(--bg-main);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.user-info h4 {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-main);
}

.user-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Content Area */
.content-area {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-header h1 {
    font-size: 1.75rem;
    margin: 0;
    color: var(--text-main);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

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

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

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

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.blue { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.1); color: var(--accent); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.stat-trend.positive { background: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.stat-trend.negative { background: rgba(244, 63, 94, 0.1); color: var(--accent); }

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-surface);
    background-clip: padding-box;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background-color: rgba(243, 244, 246, 0.5);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(243, 244, 246, 0.5);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--secondary); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: rgba(244, 63, 94, 0.1); color: var(--accent); border: 1px solid rgba(244, 63, 94, 0.2); }

.btn-block {
    width: 100%;
}

.panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    opacity: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.activity-content h4 {
    font-size: 0.875rem;
    margin: 0 0 0.25rem 0;
    color: var(--text-main);
}

.activity-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.activity-time {
    font-size: 0.7rem;
    color: #9CA3AF;
    white-space: nowrap;
    margin-left: auto;
}

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Login Page specific enhancements */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?auto=format&fit=crop&q=80') center/cover no-repeat;
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 10;
}
