/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

/* ===== Dashboard Layout ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.company-name {
    font-weight: 600;
    font-size: 15px;
}

.company-sub {
    font-size: 11px;
    opacity: 0.7;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.3);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.date-display {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    color: #64748b;
}

.btn-icon:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #ea580c;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.positive {
    color: #16a34a;
}

/* ===== Content Grid ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.view-all {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.select-period {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    cursor: pointer;
}

/* ===== Chart ===== */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding-top: 20px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bar {
    width: 36px;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 6px 6px 0 0;
    transition: all 0.3s;
    min-height: 8px;
}

.bar-group:hover .bar {
    background: linear-gradient(180deg, #2563eb 0%, #3b82f6 100%);
}

.bar-label {
    font-size: 12px;
    color: #64748b;
}

/* ===== Activity List ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
}

.activity-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f5f9;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
}

.activity-content strong {
    color: #0f172a;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
}

/* ===== Projects Table ===== */
.projects-card {
    overflow: hidden;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
}

.projects-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.projects-table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.projects-table tr:hover {
    background: #f8fafc;
}

.projects-table tr:last-child td {
    border-bottom: none;
}

.project-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #0f172a;
}

.project-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.project-dot.blue { background: #3b82f6; }
.project-dot.green { background: #22c55e; }
.project-dot.orange { background: #f97316; }
.project-dot.purple { background: #a855f7; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.in-progress {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.completed {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.review {
    background: #fef3c7;
    color: #d97706;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-fill.completed {
    background: #22c55e;
}

.progress-fill.review {
    background: #f59e0b;
}

.progress-text {
    font-size: 12px;
    color: #64748b;
    margin-left: 8px;
}

.team-avatars {
    display: flex;
}

.team-avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
    background: #f1f5f9;
}

.team-avatars img:first-child {
    margin-left: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
    }
    
    .logo-text,
    .nav-item span,
    .badge,
    .user-info {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 20px 12px;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .user-profile {
        justify-content: center;
        padding: 16px 12px;
    }
    
    .main-content {
        margin-left: 72px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
}
