/* Dashboard Layout */
:root {
    --sidebar-width: 260px;
    --header-height: 80px;
}

.dashboard-body {
    background: var(--bg-body);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
}

.brand-logo-small {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background: var(--accent-teal-soft-bg);
    color: var(--accent-teal);
}

.nav-item .icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.logout {
    color: var(--color-error);
}

.logout:hover {
    background: var(--color-error-soft);
    color: var(--color-error);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background: var(--bg-body);
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.user-welcome h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.user-welcome p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile .avatar {
    width: 48px;
    height: 48px;
    background: var(--accent-teal);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

/* AI Card */
.ai-insight-section {
    margin-bottom: 2rem;
}

.ai-card {
    background: linear-gradient(135deg, rgba(30, 127, 127, 0.1) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(30, 127, 127, 0.1);
}

.dark-mode .ai-card {
    background: linear-gradient(135deg, rgba(30, 127, 127, 0.2) 0%, rgba(17, 17, 17, 0.5) 100%);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.ai-header h3 {
    margin: 0;
    color: var(--text-main);
    flex: 1;
}

.badge.ai-badge {
    background: var(--accent-teal);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-body {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 1.05rem;
}

.ai-body ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.ai-body li {
    margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon.progress {
    background: #E0F2F1;
    color: #00897B;
}

.stat-icon.docs {
    background: #E3F2FD;
    color: #1E88E5;
}

.stat-icon.action {
    background: #FFF3E0;
    color: #FB8C00;
}

.dark-mode .stat-icon.progress {
    background: rgba(0, 137, 123, 0.2);
}

.dark-mode .stat-icon.docs {
    background: rgba(30, 136, 229, 0.2);
}

.dark-mode .stat-icon.action {
    background: rgba(251, 140, 0, 0.2);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.progress-bar-container {
    background: var(--border-subtle);
    height: 8px;
    border-radius: 4px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-teal);
    border-radius: 4px;
    transition: width 1s ease;
}

/* Tasks list */
.task-list {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.task-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-row:last-child {
    border-bottom: none;
}

.task-info h4 {
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.task-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.task-due {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-surface-muted);
}

.task-due.urgent {
    background: var(--color-error-soft);
    color: var(--color-error);
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-home-btn {
        display: flex !important;
        /* Force show on mobile */
    }
}

.mobile-home-btn {
    display: none;
    /* Hidden on desktop */
    text-decoration: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-right: 0.5rem;
}

.mobile-home-btn:hover {
    background: var(--bg-surface-muted);
    transform: translateY(-2px);
}