@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-dark: #0f172a;
    --header-bg: #0b1120;
    --sidebar-bg: #0f172a;
    --card-bg: #ffffff;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-red: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 18px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    color: #f1f5f9;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1000;
}

.sidebar .brand {
    padding: 2.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.sidebar .brand i {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.sidebar nav {
    padding: 0 1rem;
}

.nav-category {
    padding: 1.5rem 1.25rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #475569;
    font-weight: 800;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.03);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 85px;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
    color: #fff;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border-glass);
}

.topbar .breadcrumb-item, .topbar .breadcrumb-item.active {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* User Profile Modern - Capsule Style */
.user-profile-capsule {
    background: var(--glass-bg);
    border: 1px solid var(--border-glass);
    padding: 6px 6px 6px 20px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.user-profile-capsule:hover {
    background: rgba(255,255,255,0.08);
}

.user-role-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.user-name-label {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}

.user-avatar-modern {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Logout Button Modern - Circular */
.btn-logout-modern {
    background: var(--glass-bg);
    border: 1px solid var(--border-glass);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 0;
    margin: 0;
}

.btn-logout-modern:hover {
    background: var(--accent-red);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
    border-color: var(--accent-red);
}

/* Dashboard Content */
.content-body {
    padding: 2.5rem;
}

/* Modern Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.02), 0 4px 10px rgba(0,0,0,0.01);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.stat-card {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.02) 100%);
    border-radius: 0 0 0 100%;
}

.stat-card .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-weight: 800;
    font-size: 1.85rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Modern Table */
.table-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.table thead th {
    background: #f8fafc;
    border: none;
    padding: 1.25rem 1rem;
    color: #475569;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.table tbody td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.95rem;
}

/* Soft Background Utilities */
.bg-soft-primary { background: rgba(59, 130, 246, 0.1) !important; color: #3b82f6 !important; }
.bg-soft-success { background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }
.bg-soft-warning { background: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.bg-soft-danger { background: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; }
.bg-soft-purple { background: rgba(168, 85, 247, 0.1) !important; color: #a855f7 !important; }

/* Badges */
.badge {
    padding: 0.6em 1em;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Premium Search Bar in Topbar */
.search-bar-modern {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    padding: 0 1.25rem;
    height: 46px;
    width: 320px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar-modern i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-bar-modern input {
    border: none;
    background: transparent;
    color: #fff;
    padding: 0 0.75rem;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.search-bar-modern input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.search-bar-modern:focus-within {
    width: 450px;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* New Avatar and Utility Styles */
.avatar-circle-sm {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.avatar-square {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.bg-soft-orange { background: rgba(249, 115, 22, 0.1) !important; color: #f97316 !important; }
.bg-soft-info { background: rgba(14, 165, 233, 0.1) !important; color: #0ea5e9 !important; }

.smaller { font-size: 0.75rem !important; }
.x-small { font-size: 0.825rem !important; }

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

.dashboard-wrapper {
    animation: dashboardFadeIn 0.6s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Welcome Hero Section */
.welcome-hero {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.welcome-hero h2 {
    font-size: 2.2rem;
    letter-spacing: -0.02em;
}

.hero-stat-item {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.hero-stat-item:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-3px);
}

.mini-stat-hero {
    min-width: 160px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
}

.mini-stat-hero i {
    text-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.hero-decoration-1 {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-decoration-2 {
    position: absolute;
    bottom: -30px;
    left: 10%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

/* Charts and Progress Mini */
.circular-progress-mini {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #f1f5f9;
    position: relative;
}

/* Soft Backgrounds for Dash */
.bg-white.bg-opacity-10 { background-color: rgba(255, 255, 255, 0.1) !important; }
.bg-soft-primary { background: rgba(59, 130, 246, 0.1) !important; color: #3b82f6 !important; }
.bg-soft-info { background: rgba(14, 165, 233, 0.1) !important; color: #0ea5e9 !important; }
.bg-soft-success { background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }


/* --- Login Page Styles --- */
.login-wrapper {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    animation: dashboardFadeIn 0.8s ease-out;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(59, 130, 246, 0.2));
}

.login-card .logo h2 {
    font-weight: 800;
    font-size: 1.75rem;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.025em;
}

.login-card .input-group-text {
    border-color: #e2e8f0;
    color: #94a3b8;
}

.login-card .form-control {
    border-color: #e2e8f0;
    padding: 0.75rem 1rem;
}

.login-card .form-control:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}
