* {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

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

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 50px;
    text-align: center;
    max-width: 450px;
    width: 100%;
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    color: #666;
    margin-bottom: 40px;
    font-size: 16px;
}

.login-content p {
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.ms-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #2f2f2f;
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.ms-login-btn:hover {
    background: #1a1a1a;
}

.ms-icon {
    width: 21px;
    height: 21px;
}

/* Portal Page Styles */
.portal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.portal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.portal-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
}

.admin-badge {
    background: #ffd700;
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.services-grid {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.service-card.admin-only {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    gap: 10px;
}

.service-header h2 {
    color: #333;
    font-size: 22px;
    font-weight: 600;
    flex: 1;
}

.admin-label {
    background: #ffd700;
    color: #333;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.service-description {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    flex: 1;
}

.service-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: opacity 0.3s ease;
    align-self: flex-start;
}

.service-btn:hover {
    opacity: 0.9;
}

.external-icon {
    width: 16px;
    height: 16px;
}

.no-services {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-services p {
    margin-bottom: 10px;
    font-size: 16px;
}

/* Error Page Styles */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.error-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.error-box h1 {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 28px;
}

.error-message {
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.back-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #5568d3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portal-header {
        padding: 20px;
    }

    .portal-header h1 {
        font-size: 24px;
    }

    .services-grid {
        padding: 20px;
        grid-template-columns: 1fr;
    }

    .login-box, .error-box {
        padding: 30px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}
