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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.brand-logo h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 5px;
    font-weight: 700;
}

.brand-logo p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
}

/* Dashboard Styles */
.dashboard {
    display: grid;
    grid-template-areas: 
        "header header"
        "sidebar main";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 70px 1fr;
    height: 100vh;
    background: #f8fafc;
}

/* Header Styles */
.dashboard-header {
    grid-area: header;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid #e1e8ed;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-left h2 {
    color: #667eea;
    font-size: 1.8rem;
    font-weight: 700;
}

.header-left span {
    color: #666;
    font-size: 0.9rem;
}

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

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Sidebar Styles */
.sidebar {
    grid-area: sidebar;
    background: white;
    border-right: 1px solid #e1e8ed;
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-link {
    display: block;
    padding: 15px 30px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
    border-right: 4px solid #4c63d2;
}

/* Main Content Styles */
.main-content {
    grid-area: main;
    padding: 30px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-section h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Progress Section Styles */
.progress-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

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

.progress-header h4 {
    color: #2c3e50;
    font-size: 1.4rem;
}

#progressPercent {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.progress-bar {
    height: 10px;
    background: #e1e8ed;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
}

.progress-stages {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.stage.completed .stage-icon {
    background: #27ae60;
    color: white;
}

.stage.active .stage-icon {
    background: #667eea;
    color: white;
}

.stage span {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* PM Info Styles */
.pm-info {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.pm-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.pm-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pm-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.pm-details h5 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.pm-details p {
    color: #666;
    font-size: 0.9rem;
}

/* Messages Section Styles */
.messages-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    max-height: 600px;
    overflow-y: auto;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    background: #f8fafc;
}

.message.system {
    border-left-color: #27ae60;
}

.message.urgent {
    border-left-color: #e74c3c;
}

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

.message-from {
    font-weight: 600;
    color: #2c3e50;
}

.message-date {
    font-size: 0.8rem;
    color: #666;
}

.message-content {
    color: #555;
    line-height: 1.6;
}

/* Documents Section Styles */
.documents-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.document-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.document-card h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.document-item:hover {
    border-color: #667eea;
}

.document-name {
    color: #2c3e50;
    font-weight: 500;
}

.document-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.document-status.pending {
    background: #fff3cd;
    color: #856404;
}

.document-status.approved {
    background: #d4edda;
    color: #155724;
}

.document-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Query Section Styles */
.query-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.query-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.query-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e1e8ed;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        grid-template-areas: 
            "header"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: 70px 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-stages {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stage {
        flex: 0 0 45%;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}