/* ====== Light Blue Theme Vars ====== */
:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary: #0ea5e9;
    --accent: #38bdf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f0f9ff;
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-200: #bae6fd;
    --sky-300: #7dd3fc;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --sky-700: #0369a1;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / .05), 0 2px 4px -2px rgb(0 0 0 / .05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .05), 0 4px 6px -4px rgb(0 0 0 / .05);
    --transition: all .3s cubic-bezier(.4, 0, .2, 1);
    --gradient: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%);

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --content-gap: 12px;
}

/* ====== Reset / base ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
}

body {
    color: var(--gray-800);
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    min-height: 100vh;
    line-height: 1.6;
    display: block;
    padding-left: calc(var(--sidebar-width) + var(--content-gap));
    transition: var(--transition);
}

body.sidebar-collapsed {
    padding-left: calc(var(--sidebar-collapsed-width) + var(--content-gap));
}

/* ====== Sidebar ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.8);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--sky-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--sky-50), var(--sky-100));
}

.logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--sky-600);
    cursor: pointer;
    padding: .5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.toggle-sidebar:hover {
    background: var(--sky-100);
    color: var(--primary);
}

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

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-title {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sky-600);
    padding: 0 1.5rem;
    margin-bottom: .5rem;
    white-space: nowrap;
}

.sidebar.collapsed .nav-title {
    opacity: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: .75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sky-50);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: .75rem;
    color: var(--sky-600);
    flex-shrink: 0;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    color: var(--primary);
}

.nav-text {
    font-weight: 500;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge {
    display: none;
}

.nav-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: .25rem .5rem;
    font-size: .75rem;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sky-200);
    margin-top: auto;
    background: var(--sky-50);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.sidebar.collapsed .user-profile div:nth-child(2) {
    display: none;
}

/* ====== Main content ====== */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-container {
    max-width: none;
    width: 100%;
    padding: 2rem 2rem 2rem var(--content-gap);
}

/* ====== Header ====== */
.dashboard-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.9));
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: .5rem;
}

.welcome-section p {
    color: var(--sky-700);
    font-size: 1.1rem;
}

.header-actions .btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.header-actions .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

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

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow:
        0 8px 30px rgba(59, 130, 246, 0.08),
        0 4px 12px rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: cardIn 0.6s ease-out;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(59, 130, 246, 0.12),
        0 8px 20px rgba(59, 130, 246, 0.06);
}

.stat-card:hover::before {
    transform: scaleY(1.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.15);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--sky-700);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.stat-card:hover .stat-label {
    color: var(--primary-dark);
}

/* ====== Dashboard Grid (no big gaps) ====== */
.dashboard-grid {
    display: grid;
    grid-template-areas:
        "recent quick"
        "performance progress"
        "deadlines deadlines";
    grid-template-columns: 2fr 1.4fr;
    gap: 2rem;
    margin-top: 2rem;
}

.recent-section { grid-area: recent; }
.reports-section { grid-area: performance; }
.quick-actions-section { grid-area: quick; }
.progress-section { grid-area: progress; }
.deadlines-section { grid-area: deadlines; }

/* ====== Cards ====== */
.tasks-section,
.reports-section,
.quick-actions-section,
.progress-section,
.deadlines-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 0;
    box-shadow:
        0 8px 30px rgba(59, 130, 246, 0.08),
        0 4px 12px rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: cardIn 0.6s ease-out;
}

.tasks-section::before,
.reports-section::before,
.quick-actions-section::before,
.progress-section::before,
.deadlines-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.tasks-section:hover,
.reports-section:hover,
.quick-actions-section:hover,
.progress-section:hover,
.deadlines-section:hover {
    transform: translateY(-5px);
    box-shadow:
        0 20px 40px rgba(59, 130, 246, 0.12),
        0 8px 20px rgba(59, 130, 246, 0.06);
}

/* ====== Section Headers ====== */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sky-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--primary);
}

/* ====== Quick Actions ====== */
.quick-actions-section {
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow:
        0 10px 25px -5px rgba(59, 130, 246, 0.1),
        0 8px 10px -6px rgba(59, 130, 246, 0.05);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.action-card {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.action-card:hover::before {
    transform: scaleX(1);
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.action-card:hover .action-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.action-title {
    font-weight: 600;
    color: var(--sky-800);
    margin-bottom: 0.25rem;
}

.action-desc {
    font-size: 0.8rem;
    color: var(--sky-700);
}

/* ====== Weekly Progress ====== */
.progress-section {
    border: 1px solid rgba(14, 165, 233, 0.1);
    box-shadow:
        0 10px 25px -5px rgba(14, 165, 233, 0.1),
        0 8px 10px -6px rgba(14, 165, 233, 0.05);
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-weight: 600;
    color: var(--sky-800);
}

.progress-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.progress-bar {
    height: 8px;
    background: var(--sky-200);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    position: relative;
    transition: width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    width: 0;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ====== Deadlines / Next Steps ====== */
.deadlines-section {
    border: 1px solid rgba(14, 165, 233, 0.1);
    box-shadow:
        0 10px 25px -5px rgba(14, 165, 233, 0.1),
        0 8px 10px -6px rgba(14, 165, 233, 0.05);
}

.deadlines-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deadline-item {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--sky-200);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.03);
    position: relative;
    overflow: hidden;
}

.deadline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border-radius: 4px 0 0 4px;
}

.deadline-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.08);
}

.deadline-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-size: 1.1rem;
}

.deadline-content {
    flex: 1;
}

.deadline-title {
    font-weight: 600;
    color: var(--sky-800);
    margin-bottom: 0.25rem;
}

.deadline-date {
    font-size: 0.85rem;
    color: var(--sky-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deadline-date i {
    color: var(--primary);
}

.deadline-urgency {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.urgency-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.urgency-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.urgency-low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* ====== Footer ====== */
.dashboard-footer {
    margin-top: auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.9));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 2rem 1.5rem var(--content-gap);
}

.footer-link {
    color: var(--sky-700);
    text-decoration: none;
    margin-left: 1rem;
}

.footer-link:hover {
    color: var(--primary);
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
    body {
        padding-left: 0;
    }

    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-areas:
            "recent"
            "quick"
            "performance"
            "progress"
            "deadlines";
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem;
    }

    .welcome-section h1 {
        font-size: 2rem;
    }

    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        align-items: flex-start;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .tasks-section,
    .reports-section,
    .quick-actions-section,
    .progress-section,
    .deadlines-section,
    .action-card,
    .deadline-item {
        animation: none;
        transition: none;
    }

    .stat-card:hover,
    .tasks-section:hover,
    .reports-section:hover,
    .quick-actions-section:hover,
    .progress-section:hover,
    .deadlines-section:hover,
    .action-card:hover,
    .deadline-item:hover {
        transform: none;
    }
}
