* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #e8f4fd;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
nav {
    background-color: #2196F3;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .brand {
    color: #fff;
    font-size: 1.4em;
    font-weight: bold;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

nav .user-info {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9em;
}

/* Cards / Panels */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 20px;
}

.card h2 {
    color: #1976D2;
    margin-bottom: 16px;
    font-size: 1.3em;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #1976D2;
}

.btn-danger {
    background-color: #e53935;
}

.btn-danger:hover {
    background-color: #c62828;
}

.btn-secondary {
    background-color: #78909C;
}

.btn-secondary:hover {
    background-color: #607D8B;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Message list table */
.message-list {
    width: 100%;
    border-collapse: collapse;
}

.message-list th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #e0e0e0;
    color: #1976D2;
    font-size: 0.85em;
    text-transform: uppercase;
}

.message-list td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.message-list tr:hover {
    background-color: #f5faff;
}

.message-list tr.unread td {
    font-weight: 600;
}

.message-list a {
    color: #333;
    text-decoration: none;
}

.message-list a:hover {
    color: #2196F3;
}

/* Message view */
.message-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.message-header h2 {
    margin-bottom: 8px;
}

.message-meta {
    font-size: 0.9em;
    color: #666;
}

.message-meta span {
    display: block;
    margin-bottom: 2px;
}

.message-body {
    padding: 16px 0;
    line-height: 1.7;
}

.message-body.text-body {
    white-space: pre-wrap;
    font-family: inherit;
}

.message-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 80px auto;
}

.login-container .card {
    text-align: center;
}

.login-container h2 {
    color: #2196F3;
    margin-bottom: 8px;
}

.login-container p {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* Alerts */
.alert {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.alert-error {
    background-color: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Folder tabs */
.folder-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.folder-tabs a {
    padding: 8px 16px;
    text-decoration: none;
    color: #555;
    border-radius: 4px 4px 0 0;
    background-color: #e0e0e0;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.folder-tabs a:hover {
    background-color: #ccc;
}

.folder-tabs a.active {
    background-color: #fff;
    color: #2196F3;
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
