* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
}

/* Login Page Styles */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

body:has(.login-container) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-icon svg {
    width: 35px;
    height: 35px;
    color: white;
}

h1 {
    font-size: 28px;
    color: #1a202c;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    color: #718096;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 12px;
    color: #718096;
}

.info strong {
    color: #667eea;
}

/* Dashboard Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 12px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-text h2 {
    font-size: 20px;
    color: #1a202c;
}

.logo-text p {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.nav-menu {
    padding: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.main-content {
    margin-left: 280px;
    padding: 24px 32px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    color: #1a202c;
    text-align: left;
}

.page-title p {
    color: #718096;
    margin-top: 4px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.logout-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #e53e3e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-title {
    color: #718096;
    font-size: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #ebf4ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
}

.email-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: auto;
}

.email-list {
    max-height: 600px;
    overflow-y: auto;
}

.email-item {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s;
}

.email-item:hover {
    background: #f7fafc;
}

.email-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.email-from {
    font-weight: 600;
    color: #1a202c;
}

.email-date {
    font-size: 12px;
    color: #a0aec0;
}

.email-subject {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 8px;
}

.email-preview {
    font-size: 14px;
    color: #718096;
}

.attachment-badge {
    color: #48bb78;
    font-size: 12px;
    margin-top: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #e53e3e;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
}