/**
 * Стили веб-интерфейса в стиле Mail.ru
 * @package Mailer
 */

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные переменные Mail.ru */
:root {
    --mail-primary: #1e983a;
    --mail-primary-hover: #1a7d30;
    --mail-bg: #ffffff;
    --mail-bg-secondary: #f5f5f6;
    --mail-bg-hover: #f0f2f5;
    --mail-text: #000000;
    --mail-text-secondary: #707579;
    --mail-border: #e0e0e0;
    --mail-unread-bg: #e8f5e9;
    --mail-sidebar-width: 240px;
    --mail-header-height: 56px;
    --mail-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    height: 100%;
    overflow-y: auto; /* Прокрутка всей страницы */
    overflow-x: hidden;
}

body {
    font-family: var(--mail-font);
    font-size: 15px;
    line-height: 1.4;
    color: var(--mail-text);
    background-color: var(--mail-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Страница входа */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e983a 0%, #1a7d30 100%);
}

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

.login-box {
    background: var(--mail-bg);
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--mail-primary);
    font-size: 28px;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: var(--mail-text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--mail-text);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mail-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--mail-font);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--mail-primary);
    box-shadow: 0 0 0 3px rgba(30, 152, 58, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--mail-text-secondary);
    font-size: 13px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--mail-font);
}

.btn-primary {
    background-color: var(--mail-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--mail-primary-hover);
}

.btn-secondary {
    background-color: var(--mail-bg-secondary);
    color: var(--mail-text);
    border: 1px solid var(--mail-border);
}

.btn-secondary:hover {
    background-color: var(--mail-bg-hover);
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

/* Алерты */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fff5f5;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

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

/* Шапка в стиле Mail.ru */
.main-header {
    background-color: var(--mail-bg);
    border-bottom: 1px solid var(--mail-border);
    height: var(--mail-header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    margin-right: 32px;
}

.logo a {
    font-size: 22px;
    font-weight: 700;
    color: var(--mail-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo a::before {
    content: '@';
    font-size: 26px;
    font-weight: 400;
}

.header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--mail-border);
    border-radius: 20px;
    font-size: 15px;
    background-color: var(--mail-bg-secondary);
    transition: all 0.2s;
}

.header-search input:focus {
    outline: none;
    background-color: var(--mail-bg);
    border-color: var(--mail-primary);
    box-shadow: 0 0 0 3px rgba(30, 152, 58, 0.1);
}

.header-search::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 24px;
}

.user-name {
    font-size: 15px;
    color: var(--mail-text);
    font-weight: 500;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mail-primary), #1a7d30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
}

/* Основной контейнер */
.main-container {
    display: flex;
    min-height: calc(100vh - var(--mail-header-height));
    height: auto; /* Автоматическая высота */
    overflow: visible; /* Убираем overflow: hidden - прокручивается вся страница */
}

/* Боковая панель в стиле Mail.ru */
.sidebar {
    width: var(--mail-sidebar-width);
    background-color: var(--mail-bg);
    border-right: 1px solid var(--mail-border);
    overflow: visible; /* Убираем отдельную прокрутку - прокручивается вся страница */
    padding: 16px 0;
    height: auto; /* Автоматическая высота */
    flex-shrink: 0; /* Не сжимается */
}

/* Скроллбар sidebar больше не нужен, так как прокручивается вся страница */

/* Кнопка "Написать письмо" */
.btn-compose {
    background: linear-gradient(135deg, var(--mail-primary) 0%, var(--mail-primary-hover) 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    box-shadow: 0 2px 8px rgba(30, 152, 58, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-compose:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 152, 58, 0.4);
}

.btn-compose::before {
    content: '✉️';
    font-size: 18px;
}

.sidebar-nav {
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--mail-text);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 15px;
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
}

.nav-item:hover {
    background-color: var(--mail-bg-hover);
}

.nav-item.active {
    background-color: var(--mail-unread-bg);
    color: var(--mail-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: var(--mail-primary);
    border-radius: 0 2px 2px 0;
}

.nav-item-count {
    margin-left: auto;
    background-color: var(--mail-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.nav-item.active .nav-item-count {
    background-color: var(--mail-primary);
}

.sidebar-section {
    padding: 16px 8px;
    border-top: 1px solid var(--mail-border);
    margin-top: 8px;
}

.sidebar-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--mail-text-secondary);
    margin-bottom: 8px;
    padding: 0 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--mail-border);
    margin-top: auto;
}

/* Область контента */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--mail-bg-secondary);
    overflow: visible; /* Убираем отдельную прокрутку - прокручивается вся страница */
    height: auto; /* Автоматическая высота */
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--mail-bg);
    border-bottom: 1px solid var(--mail-border);
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.toolbar-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-close-bulk {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--mail-text-secondary);
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
    margin-right: 4px;
}

.btn-close-bulk:hover {
    color: var(--mail-text);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.toolbar h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--mail-text);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

/* Список писем в стиле Mail.ru */
.messages-list {
    flex: 1;
    overflow: visible; /* Убираем отдельную прокрутку - прокручивается вся страница */
    background-color: var(--mail-bg);
    height: auto; /* Автоматическая высота */
    min-height: 0; /* Убираем ограничение */
}

.messages-list::-webkit-scrollbar {
    width: 8px;
}

.messages-list::-webkit-scrollbar-track {
    background: transparent;
}

.messages-list::-webkit-scrollbar-thumb {
    background: var(--mail-border);
    border-radius: 4px;
}

.message-item {
    display: grid;
    grid-template-columns: 40px 40px 200px 1fr 140px 40px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--mail-border);
    cursor: pointer;
    transition: background-color 0.15s;
    gap: 16px;
    position: relative;
    background-color: var(--mail-bg); /* Прочитанные письма с фоном */
}

.message-item:hover {
    background-color: var(--mail-bg-hover);
}

.message-item.unread {
    background-color: var(--mail-unread-bg) !important;
    font-weight: 500 !important;
}

/* Прочитанные письма - светлый фон для лучшей видимости */
.message-item:not(.unread) {
    background-color: var(--mail-bg) !important;
    font-weight: normal !important;
}

/* При наведении на прочитанное письмо - легкий hover, на непрочитанное - более заметный */
.message-item.unread:hover {
    background-color: var(--mail-unread-bg);
    opacity: 0.9;
}

.message-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--mail-primary);
}

.message-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.message-star {
    display: flex;
    align-items: center;
    justify-content: center;
}

.star {
    color: #d0d0d0;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.star:hover {
    color: #fbbc04;
}

.star.starred {
    color: #fbbc04;
}

.message-from {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 15px;
}

.message-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.message-subject a {
    color: var(--mail-text);
    text-decoration: none;
}

.message-item.unread .message-subject a {
    font-weight: 600;
}

.message-date {
    text-align: right;
    color: var(--mail-text-secondary);
    font-size: 13px;
}

.message-attachment {
    text-align: center;
    font-size: 16px;
    color: var(--mail-text-secondary);
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background-color: var(--mail-bg);
    border-top: 1px solid var(--mail-border);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--mail-text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-top: 16px;
}

/* Подвал */
.main-footer {
    text-align: center;
    padding: 16px;
    color: var(--mail-text-secondary);
    font-size: 13px;
    background-color: var(--mail-bg);
    border-top: 1px solid var(--mail-border);
}

/* Страница ошибки */
.error-page {
    text-align: center;
    padding: 120px 20px;
    background-color: var(--mail-bg);
}

.error-page h1 {
    font-size: 72px;
    color: var(--mail-text-secondary);
    margin-bottom: 16px;
    font-weight: 300;
}

/* Форма написания письма */
.compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--mail-bg);
    border-bottom: 1px solid var(--mail-border);
}

.compose-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--mail-text);
}

.compose-actions {
    display: flex;
    gap: 8px;
}

.compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--mail-bg);
    padding: 24px;
    overflow-y: auto;
}

.compose-form .form-group {
    margin-bottom: 20px;
}

.compose-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--mail-text);
    font-size: 14px;
}

.compose-form .required {
    color: #d32f2f;
}

.compose-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mail-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--mail-font);
    transition: all 0.2s;
}

.compose-form .form-control:focus {
    outline: none;
    border-color: var(--mail-primary);
    box-shadow: 0 0 0 3px rgba(30, 152, 58, 0.1);
}

.compose-form textarea.form-control {
    resize: vertical;
    min-height: 400px;
    font-family: var(--mail-font);
}

/* Полноэкранный режим для мобильных */
.compose-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background-color: var(--mail-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.compose-fullscreen .main-header,
.compose-fullscreen .sidebar {
    display: none;
}

.compose-fullscreen .content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.compose-fullscreen .compose-header {
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mail-border);
    background-color: var(--mail-bg);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.compose-fullscreen .compose-header h2 {
    font-size: 18px;
    margin: 0;
    flex: 1;
}

.compose-fullscreen .compose-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.compose-fullscreen .compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.compose-fullscreen .compose-form textarea.form-control {
    min-height: auto;
    font-size: 16px; /* Предотвращает зум на iOS */
}

.compose-fullscreen .form-group {
    display: flex;
    flex-direction: column;
}

.compose-fullscreen .form-group-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Важно для flex */
}

.compose-fullscreen .form-group label {
    flex-shrink: 0;
}

.compose-fullscreen .form-group-body textarea {
    flex: 1;
    min-height: 0; /* Важно для flex */
}

.compose-fullscreen .form-actions {
    flex-shrink: 0;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--mail-border);
    position: sticky;
    bottom: 0;
    background-color: var(--mail-bg);
    padding-bottom: 16px;
}

.compose-fullscreen-btn-close {
    display: none;
}

.compose-fullscreen .compose-fullscreen-btn-close {
    display: flex !important;
    background: none;
    border: none;
    color: var(--mail-text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
    z-index: 1;
}

.compose-fullscreen .compose-fullscreen-btn-close:hover,
.compose-fullscreen .compose-fullscreen-btn-close:active {
    background-color: var(--mail-bg-hover);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--mail-border);
}

/* Список вложений для compose страницы */
.compose-form .attachments-list,
#compose-form .attachments-list,
form.compose-form .attachments-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    margin-top: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    width: 100% !important;
    max-height: none !important;
}

/* Общий селектор для обратной совместимости */
.attachments-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    margin-top: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-height: none !important;
}

.attachment-item {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    background: var(--mail-bg);
    border: 1px solid var(--mail-border);
    border-radius: 8px;
    padding: 2px !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    flex-shrink: 0 !important; /* Не сжимать элементы при горизонтальной прокрутке */
}

.attachment-item .attachment-preview {
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 4px;
    background: var(--mail-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Дубликат удален - стили определены ниже */

.attachment-item .attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-item .attachment-preview .file-icon {
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.attachment-item .attachment-preview .loading,
.attachment-item .attachment-preview .error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--mail-text-secondary);
    font-size: 12px;
}

.attachment-item .attachment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.attachment-item .attachment-info {
    position: relative;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.attachment-item .attachment-name {
    font-size: 10px;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.attachment-item .attachment-size {
    color: var(--mail-text-secondary);
    font-size: 9px;
    text-align: center;
}

.attachment-item .btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.attachment-item .btn-remove:hover {
    background: rgba(255, 68, 68, 0.9);
    color: white;
}

/* Для изображений - размер 96x96, с названием файла снизу */
.attachment-item.attachment-image {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    min-height: auto !important;
    height: auto !important;
    padding: 2px !important;
    flex-shrink: 0 !important;
}

.attachment-item.attachment-image .attachment-preview {
    width: 96px !important;
    height: 96px !important;
    margin-bottom: 4px !important;
    flex-shrink: 0 !important;
}

.attachment-item.attachment-image .attachment-info-image {
    position: relative !important;
    padding: 0 !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    align-items: center !important;
}

.attachment-item.attachment-image .attachment-name {
    font-size: 10px !important;
    text-align: center !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
    max-width: 96px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.attachment-item.attachment-image .attachment-size {
    font-size: 9px !important;
    text-align: center !important;
}

/* Для изображений - кнопка удаления на превью */
.attachment-item.attachment-image .btn-remove {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: none !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 20px !important;
    padding: 0 !important;
}

.attachment-item.attachment-image .btn-remove:hover {
    background: rgba(255, 68, 68, 0.9) !important;
    color: white !important;
}

.attachment-item.attachment-error {
    border-color: #ff4444;
    background: #fff5f5;
}

.attachment-item .error-text {
    color: #ff4444;
    font-weight: 500;
}

.btn-remove:hover {
    color: #d32f2f;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background-color: #2e7d32;
    color: white;
}

.notification-error {
    background-color: #d32f2f;
    color: white;
}

/* Группировка писем по датам */
.messages-group {
    border-bottom: 1px solid var(--mail-border);
}

.messages-group-header {
    padding: 12px 20px;
    background-color: var(--mail-bg-secondary);
    font-size: 13px;
    font-weight: 600;
    color: var(--mail-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--mail-border);
}

/* Просмотр письма */
.message-view {
    display: flex;
    flex-direction: column;
    height: auto; /* Автоматическая высота вместо 100% */
    min-height: 100%; /* Минимум высота экрана */
    background-color: var(--mail-bg);
}

.message-view-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--mail-border);
    background-color: var(--mail-bg);
    flex-shrink: 0;
    order: 1;
}

.message-view-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.message-view-content {
    flex: none; /* Убираем flex: 1, чтобы не ограничивало высоту */
    overflow: visible; /* Убираем отдельную прокрутку - прокручивается вся страница */
    padding: 24px;
    display: flex;
    flex-direction: column;
    order: 2;
    height: auto; /* Автоматическая высота */
    min-height: 0; /* Убираем ограничение минимальной высоты */
}

.message-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--mail-border);
    order: 1;
    flex-shrink: 0;
}

.message-header-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.message-sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mail-primary), #1a7d30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
    flex-shrink: 0;
}

.message-header-info {
    flex: 1;
}

.message-sender-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--mail-text);
    margin-bottom: 4px;
}

.message-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--mail-text-secondary);
}

.message-subject-full {
    font-size: 20px;
    font-weight: 600;
    color: var(--mail-text);
    margin-top: 12px;
}

.message-attachments {
    margin: 24px 0;
    padding: 16px;
    background-color: var(--mail-bg-secondary);
    border-radius: 8px;
    order: 2;
    flex-shrink: 0;
}

.message-attachments h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--mail-text);
}

/* Список вложений для просмотра письма - перенос на новые строки, без отдельной прокрутки */
.message-attachments .attachments-list,
.message-attachments-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important; /* Позволяем перенос на новые строки */
    overflow: visible !important; /* Убираем отдельную прокрутку - прокручивается вся страница */
    gap: 12px !important;
    padding-bottom: 8px !important;
    width: 100% !important;
    height: auto !important; /* Автоматическая высота */
}

/* Вложения в просмотре письма */
.message-attachments .attachment-item {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--mail-bg) !important;
    border: 1px solid var(--mail-border) !important;
    border-radius: 8px !important;
    padding: 4px !important;
    position: relative !important;
}

/* Все вложения (включая изображения) - размер 96x96 */
.message-attachments .attachment-item {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

.message-attachments .attachment-item .attachment-preview {
    width: 96px !important;
    height: 96px !important;
    overflow: hidden !important;
    border-radius: 4px !important;
    margin-bottom: 4px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--mail-bg-secondary) !important;
    box-sizing: border-box !important;
}

.message-attachments .attachment-item .attachment-preview img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
}


.message-attachments .attachment-item .attachment-preview .file-icon {
    font-size: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

.message-attachments .attachment-item .attachment-info {
    position: relative !important;
    padding: 0 !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    align-items: center !important;
}

.message-attachments .attachment-item .attachment-name {
    font-size: 10px !important;
    text-align: center !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
    color: var(--mail-text) !important;
}

/* Все вложения - фиксированная ширина названия */
.message-attachments .attachment-item .attachment-name {
    max-width: 96px !important;
}

.message-attachments .attachment-item .attachment-size {
    color: var(--mail-text-secondary) !important;
    font-size: 9px !important;
    text-align: center !important;
}

.message-attachments .attachment-item .btn-download {
    margin-top: 4px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    width: 100% !important;
    text-align: center !important;
}

.attachment-icon {
    font-size: 20px;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
}

.attachment-size {
    color: var(--mail-text-secondary);
    font-size: 13px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.message-body {
    margin: 24px 0;
    padding: 20px;
    background-color: var(--mail-bg);
    border-radius: 8px;
    min-height: 200px;
    order: 3;
    flex-shrink: 0;
}

.message-body-html {
    line-height: 1.6;
}

.message-body-text {
    white-space: pre-wrap;
    line-height: 1.6;
    font-family: var(--mail-font);
}

.message-footer-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--mail-border);
    order: 4;
    flex-shrink: 0;
    margin-top: auto;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--mail-bg);
    border: 1px solid var(--mail-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1000;
    display: none;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--mail-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s;
}

.dropdown-menu a:hover {
    background-color: var(--mail-bg-hover);
}

/* Настройки */
.settings-page {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.settings-page h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--mail-text);
}

.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--mail-border);
    margin-bottom: 24px;
}

.settings-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--mail-text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.settings-tab:hover {
    color: var(--mail-primary);
}

.settings-tab.active {
    color: var(--mail-primary);
    border-bottom-color: var(--mail-primary);
}

.settings-content {
    max-width: 600px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-form .form-group {
    margin-bottom: 0;
}

.settings-form select.form-control {
    padding: 10px 12px;
}

/* Адресная книга */
.contacts-list {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background-color: var(--mail-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--mail-border);
    transition: all 0.2s;
}

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

.contact-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mail-primary), #1a7d30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 24px;
    margin: 0 auto 12px;
}

.contact-info {
    text-align: center;
    margin-bottom: 12px;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--mail-text);
    margin-bottom: 4px;
}

.contact-email {
    font-size: 14px;
    color: var(--mail-text-secondary);
    margin-bottom: 4px;
}

.contact-phone {
    font-size: 13px;
    color: var(--mail-text-secondary);
}

.contact-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Фильтры */
.filters-list {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.filters-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: var(--mail-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--mail-border);
}

.filter-info {
    flex: 1;
}

.filter-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--mail-text);
    margin-bottom: 8px;
}

.filter-inactive {
    font-size: 13px;
    color: var(--mail-text-secondary);
    font-weight: normal;
}

.filter-condition {
    font-size: 14px;
    color: var(--mail-text-secondary);
    line-height: 1.5;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* Административная панель */
.admin-page {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--mail-border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--mail-text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: var(--mail-primary);
}

.admin-tab.active {
    color: var(--mail-primary);
    border-bottom-color: var(--mail-primary);
}

.admin-content {
    min-height: 400px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, var(--mail-primary), #1a7d30);
    color: white;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.stats-section {
    margin-top: 32px;
}

.stats-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--mail-text);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--mail-bg);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table thead {
    background-color: var(--mail-bg-secondary);
}

.admin-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--mail-text);
    border-bottom: 2px solid var(--mail-border);
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--mail-border);
    font-size: 14px;
}

.admin-table tbody tr:hover {
    background-color: var(--mail-bg-hover);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-error {
    background-color: #ffebee;
    color: #c62828;
}

.admin-section {
    margin-bottom: 32px;
}

.admin-section h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--mail-text);
}

.admin-form {
    background-color: var(--mail-bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* Поиск */
.search-page {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.search-form {
    margin-bottom: 24px;
}

.search-main {
    margin-bottom: 16px;
}

.search-input-group {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--mail-border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--mail-primary);
    box-shadow: 0 0 0 3px rgba(30, 152, 58, 0.1);
}

.search-filters {
    margin-top: 16px;
}

.search-filters-details {
    cursor: pointer;
    padding: 12px;
    background-color: var(--mail-bg-secondary);
    border-radius: 8px;
}

.search-filters-details summary {
    font-weight: 500;
    color: var(--mail-text);
    user-select: none;
}

.search-filters-content {
    margin-top: 16px;
    padding: 16px;
    background-color: var(--mail-bg);
    border-radius: 8px;
}

.search-results {
    margin-top: 24px;
}

.search-results-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mail-border);
}

.search-results-header h3 {
    font-size: 18px;
    color: var(--mail-text);
}

.message-folder-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background-color: var(--mail-bg-secondary);
    border-radius: 4px;
    font-size: 11px;
    color: var(--mail-text-secondary);
    text-transform: uppercase;
}

/* Папки и метки */
.folders-list, .labels-list {
    background-color: var(--mail-bg);
    border-radius: 8px;
    padding: 24px;
}

.folders-grid, .labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.folder-card, .label-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--mail-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--mail-border);
    transition: all 0.2s;
}

.folder-card:hover, .label-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.folder-icon {
    font-size: 32px;
}

.folder-info, .label-info {
    flex: 1;
}

.folder-name, .label-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--mail-text);
    margin-bottom: 4px;
}

.folder-count, .label-count {
    font-size: 13px;
    color: var(--mail-text-secondary);
}

.folder-actions, .label-actions {
    display: flex;
    gap: 8px;
}

.label-color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.label-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Адаптивность */
@media (max-width: 1024px) {
    :root {
        --mail-sidebar-width: 200px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    /* Адаптивные кнопки в просмотре письма */
    .message-view-header {
        padding: 8px 12px !important;
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: var(--mail-bg) !important;
    }
    
    .message-view-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }
    
    .message-view-actions .btn {
        padding: 8px 6px !important;
        font-size: 12px !important;
        min-height: 36px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .message-view-actions .btn:first-child {
        grid-column: 1 / -1;
    }
    
    .message-view-actions .dropdown {
        grid-column: 3;
    }
    
    /* Контент письма не должен перекрываться - секции идут последовательно */
    .message-view-content {
        padding: 12px !important;
        position: relative;
        z-index: 1;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        overflow: visible !important; /* Убираем отдельную прокрутку */
        height: auto !important; /* Автоматическая высота */
        flex: none !important; /* Убираем flex: 1, чтобы не ограничивало высоту */
    }
    
    .message-header {
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
        order: 1 !important;
        flex-shrink: 0 !important;
    }
    
    .message-attachments {
        margin: 16px 0 !important;
        padding: 12px !important;
        position: relative;
        z-index: 1;
        order: 2 !important;
        flex-shrink: 0 !important;
    }
    
    .message-body {
        margin: 16px 0 !important;
        padding: 16px !important;
        position: relative;
        z-index: 1;
        order: 3 !important;
        flex-shrink: 0 !important;
    }
    
    .message-footer-actions {
        position: relative !important; /* Убираем sticky, чтобы не перекрывало */
        bottom: auto !important;
        background-color: var(--mail-bg);
        padding: 12px !important;
        border-top: 1px solid var(--mail-border);
        z-index: 1;
        display: flex;
        gap: 8px;
        margin-top: 20px !important;
    }
    
    .message-footer-actions .btn {
        flex: 1;
        padding: 10px !important;
        font-size: 13px !important;
    }
    
    /* Увеличиваем отступы для вложений, чтобы не нужно было скроллить */
    .message-attachments {
        margin: 16px 0 40px 0 !important; /* Больше отступ снизу */
        padding: 12px !important;
        position: relative;
        z-index: 1;
        order: 2 !important;
        flex-shrink: 0 !important;
        min-height: auto !important; /* Убираем ограничение высоты */
    }
    
    .message-attachments .attachments-list {
        max-height: none !important; /* Убираем ограничение высоты */
        overflow: visible !important; /* Убираем отдельную прокрутку */
        flex-wrap: wrap !important; /* Позволяем перенос на новые строки */
    }
    
    /* Убеждаемся, что контент не перекрывается */
    .content-area {
        position: relative;
        z-index: 1;
        padding-bottom: 20px; /* Уменьшаем отступ, так как sticky убран */
    }
    
    .message-view {
        position: relative;
        z-index: 1;
    }
    
    /* Бургер-меню */
    .burger-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 32px;
        height: 32px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 4px;
        margin-left: 12px; /* Отступ слева от аватара */
        z-index: 1001;
    }
    
    .burger-menu-btn span {
        width: 24px;
        height: 3px;
        background-color: var(--mail-text);
        border-radius: 2px;
        transition: all 0.3s;
        display: block;
    }
    
    .burger-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .burger-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .burger-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    /* На десктопе бургер-меню скрыто */
    @media (min-width: 769px) {
        .burger-menu-btn {
            display: none !important;
        }
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--mail-border);
        height: auto;
        max-height: none;
        position: fixed;
        top: var(--mail-header-height);
        left: -100%;
        width: 280px;
        height: calc(100vh - var(--mail-header-height));
        background-color: var(--mail-bg);
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.sidebar-open {
        left: 0;
    }
    
    /* Затемнение фона при открытом sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--mail-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar.sidebar-open + .sidebar-overlay,
    .sidebar-open ~ .sidebar-overlay {
        display: block;
    }
    
    .header-content {
        flex-wrap: wrap;
        padding: 8px 16px;
    }
    
    /* На телефоне убираем поиск из хедера, чтобы не занимал место */
    .header-search {
        display: none;
    }
    
    .logo {
        margin-right: 0;
    }
    
    .compose-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .compose-header h2 {
        flex: 1;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .message-item {
        grid-template-columns: 30px 30px 1fr 100px;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .message-from {
        display: none;
    }
    
    /* На мобильных textarea изначально меньше */
    .compose-form textarea.form-control {
        min-height: 200px;
    }
    
    /* Кнопка закрытия полноэкранного режима видна только в полноэкранном режиме */
    .compose-fullscreen-btn-close {
        display: none;
    }

    /* Страница написания письма: убираем боковое меню, оставляем только форму */
    .page-compose .sidebar {
        display: none;
    }

    .page-compose .main-container {
        flex-direction: column;
    }

    .page-compose .content-area {
        width: 100%;
        max-width: 100%;
        min-height: calc(100vh - var(--mail-header-height));
    }
}

/* Темная тема */
body.theme-dark {
    --mail-bg: #1a1a1a;
    --mail-bg-secondary: #0f0f0f;
    --mail-bg-hover: #2a2a2a;
    --mail-unread-bg: #1a2a3a; /* Темно-синий для непрочитанных */
    --mail-text: #e0e0e0;
    --mail-text-secondary: #a0a0a0;
    --mail-border: #333333;
    --mail-unread-bg: #1a2a3a;
    background-color: var(--mail-bg-secondary);
    color: var(--mail-text);
}

body.theme-dark .main-header {
    background-color: var(--mail-bg);
    border-bottom-color: var(--mail-border);
}

body.theme-dark .sidebar {
    background-color: var(--mail-bg);
    border-right-color: var(--mail-border);
}

body.theme-dark .content-area {
    background-color: var(--mail-bg-secondary);
}

body.theme-dark .message-item {
    border-bottom-color: var(--mail-border);
    background-color: var(--mail-bg); /* Прочитанные письма с темным фоном */
}

body.theme-dark .message-item:hover {
    background-color: var(--mail-bg-hover);
}

/* Прочитанные письма - более темный фон для лучшей видимости */
body.theme-dark .message-item:not(.unread) {
    background-color: #0f0f0f !important; /* Почти черный фон для прочитанных */
    font-weight: normal !important;
}

/* Убеждаемся, что непрочитанные письма выделяются */
body.theme-dark .message-item.unread {
    background-color: #1a2a3a !important; /* Темно-синий для непрочитанных */
    font-weight: 500 !important;
}

body.theme-dark .message-item.unread:hover {
    background-color: var(--mail-unread-bg);
    opacity: 0.9;
}

body.theme-dark .form-control,
body.theme-dark input[type="text"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark textarea,
body.theme-dark select {
    background-color: var(--mail-bg);
    border-color: var(--mail-border);
    color: var(--mail-text);
}

body.theme-dark .btn {
    background-color: var(--mail-primary);
    color: white;
}

body.theme-dark .btn-secondary {
    background-color: var(--mail-bg-hover);
    color: var(--mail-text);
}

body.theme-dark .toolbar {
    border-bottom-color: var(--mail-border);
}

body.theme-dark .login-box {
    background-color: var(--mail-bg);
}

body.theme-dark .settings-page,
body.theme-dark .compose-page {
    background-color: var(--mail-bg);
}

body.theme-dark .user-menu-dropdown {
    background-color: var(--mail-bg);
    border-color: var(--mail-border);
}
