/* 
  TaskFlow - Dashboard Styles
*/

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition-normal);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    gap: 0.75rem;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    border-right: 3px solid var(--primary-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Nav */
.top-nav {
    height: 70px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    position: relative;
    width: 400px;
}

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

.search-bar input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

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

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

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

.stat-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

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

.stat-info h4 {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Task List */
.task-container {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.task-filters {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    overflow-x: auto;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.task-list {
    padding: 0;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    margin-right: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.task-checkbox.checked {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.badge-low { background: #DCFCE7; color: #166534; }
.badge-medium { background: #FEF9C3; color: #854D0E; }
.badge-high { background: #FFEDD5; color: #9A3412; }
.badge-urgent { background: #FEE2E2; color: #991B1B; }

.task-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.task-item:hover .task-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.modal-body .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-body .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.modal-body .form-control,
.modal-body select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.modal-body .form-control:focus,
.modal-body select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-body .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-body .form-grid .form-group {
    margin-bottom: 0;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .sidebar-header h2, .nav-item span { display: none; }
    .main-content { margin-left: 80px; }
    .search-bar { width: 250px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); width: 260px; }
    .sidebar.active .sidebar-header h2, .sidebar.active .nav-item span { display: block; }
    .main-content { margin-left: 0; }
    .top-nav { padding: 0 1rem; }
    .search-bar { display: none; }
    
    .modal-body .form-grid {
        grid-template-columns: 1fr;
    }
}
