@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono&display=swap');

:root {
    --primary: #1e6adf;
    --primary-dark: #1558c0;
    --primary-light: #eff4ff;
    --sidebar-bg: #1e2940;
    --sidebar-text: #a8b8d8;
    --sidebar-active: #2a3f6a;
    --sidebar-hover: #243252;
    --header-bg: #1a2236;
    --header-h: 52px;
    --nav-h: 38px;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f1f5f9;
    --white: #ffffff;
    --unread-bg: #eef4ff;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --badge: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 6px;
}

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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

    body.theme-light {
        --primary: #0f6ddf;
        --primary-dark: #0b57b7;
        --primary-light: #eaf3ff;
        --sidebar-bg: #f8fafc;
        --sidebar-text: #334155;
        --sidebar-active: #dbeafe;
        --sidebar-hover: #e2e8f0;
        --header-bg: #ffffff;
        --border: #dbe3ef;
        --text: #0f172a;
        --text-light: #475569;
        --bg: #ffffff;
        --white: #ffffff;
        --unread-bg: #eff6ff;
        --shadow: 0 1px 4px rgba(15,23,42,0.08);
    }

    body.theme-dark {
        --primary: #38bdf8;
        --primary-dark: #0ea5e9;
        --primary-light: #102a43;
        --sidebar-bg: #0f172a;
        --sidebar-active: #1e293b;
        --sidebar-hover: #172033;
        --header-bg: #020617;
        --border: #334155;
        --text: #e2e8f0;
        --text-light: #94a3b8;
        --bg: #111827;
        --white: #1e293b;
        --unread-bg: #162033;
        --shadow: 0 1px 3px rgba(0,0,0,0.35);
    }

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* HEADER */
.app-header {
    height: var(--header-h);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.theme-light .app-header,
body.theme-light .app-nav {
    border-color: var(--border);
}

body.theme-light .logo-small,
body.theme-light .user-btn,
body.theme-light .btn-gsearch {
    color: var(--text);
}

body.theme-light .sidebar-toggle,
body.theme-light .header-btn,
body.theme-light .nav-item {
    color: var(--text-light);
}

body.theme-light .global-search-input,
body.theme-light .btn-gsearch {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text);
}

    body.theme-light .global-search-input::placeholder {
        color: #94a3b8;
    }

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.header-center {
    flex: 1;
    max-width: 500px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    font-weight: 300;
}

    .logo-small .logo-icon {
        font-size: 20px;
    }

    .logo-small strong {
        font-weight: 600;
        color: #60a5fa;
    }

.global-search {
    display: flex;
    gap: 6px;
}

.global-search-input {
    flex: 1;
    padding: 7px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 300px;
    transition: all 0.2s;
}

    .global-search-input::placeholder {
        color: rgba(255,255,255,0.4);
    }

    .global-search-input:focus {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.3);
    }

.btn-gsearch {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: white;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

    .btn-gsearch:hover {
        background: rgba(255,255,255,0.2);
    }

.header-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

    .header-btn:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }

.user-menu-wrap {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

    .user-btn:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
}

    .user-dropdown.open {
        display: block;
    }

.user-dd-header {
    padding: 10px 16px 8px;
}

    .user-dd-header strong {
        display: block;
        font-size: 14px;
        color: var(--text);
    }

    .user-dd-header small {
        color: var(--text-light);
        font-size: 12px;
    }

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.user-dropdown a, .user-dropdown .LinkButton {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}

    .user-dropdown a:hover, .user-dropdown .LinkButton:hover {
        background: #f8fafc;
    }

/* NAV */
.app-nav {
    height: var(--nav-h);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 2px solid rgba(255,255,255,0.08);
}

.nav-item {
    padding: 6px 14px;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

    .nav-item:hover {
        background: rgba(255,255,255,0.08);
        color: white;
        text-decoration: none;
    }

    .nav-item.active {
        background: rgba(59,130,246,0.2);
        color: #60a5fa;
    }

/* CONTENT */
.app-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

    .btn-secondary:hover {
        background: #cbd5e1;
    }

.btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

    .btn-danger:hover {
        background: #fecaca;
    }

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

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

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #475569;
        margin-bottom: 5px;
    }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: white;
    outline: none;
    transition: all 0.2s;
}

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(30,106,223,0.1);
    }

    .form-control[readonly] {
        background: #f8fafc;
        color: var(--text-light);
    }

.form-control-sm {
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    background: white;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

-e
/* ============================================================
   MAILBOX — issu de mailbox.css (inchangé)
   ============================================================ */
/* ===== SIDEBAR ===== */
:root {
    --menu-column-width: 280px;
}

.sidebar,
.contacts-sidebar,
.calendar-sidebar {
    width: var(--menu-column-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: width 0.3s ease;
}

    .sidebar.collapsed {
        width: 0;
        overflow: hidden;
    }

.compose-btn-wrap {
    padding: 14px 12px 10px;
}

.btn-compose {
    width: 100%;
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

    .btn-compose:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(30,106,223,0.3);
    }

.folder-section-title {
    padding: 12px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #546e8a;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.folder-item {
    display: block;
}

    .folder-item a, .folder-item .LinkButton {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px;
        color: var(--sidebar-text);
        font-size: 13.5px;
        text-decoration: none;
        transition: all 0.15s;
        border: none;
        background: transparent;
        width: 100%;
        text-align: left;
        font-family: inherit;
        cursor: pointer;
        border-radius: 0;
    }

        .folder-item a:hover, .folder-item .LinkButton:hover {
            background: var(--sidebar-hover);
            color: #e2e8f0;
            text-decoration: none;
        }

    .folder-item.active a, .folder-item.active .LinkButton {
        background: var(--sidebar-active);
        color: white;
        border-left: 3px solid var(--primary);
    }

.folder-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.folder-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    background: var(--badge);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.quota-bar {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.quota-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #546e8a;
    margin-bottom: 6px;
}

.quota-track {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 2px;
    transition: width 0.5s;
}

/* ===== MESSAGE LIST ===== */
.message-list-panel {
    width: 320px;
    flex-shrink: 0;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    gap: 6px;
    flex-wrap: wrap;
}

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

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.check-all {
    cursor: pointer;
}

.btn-tool {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 9px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-light);
    font-family: inherit;
    transition: all 0.15s;
}

    .btn-tool:hover {
        background: var(--bg);
        color: var(--text);
    }

.select-move {
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 8px;
    background: white;
    color: var(--text-light);
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.search-box {
    display: flex;
    gap: 4px;
}

.search-input {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    width: 160px;
    color: var(--text);
}

    .search-input:focus {
        border-color: var(--primary);
    }

.btn-search {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

    .btn-search:hover {
        background: var(--bg);
    }

.folder-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.folder-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.msg-count {
    font-size: 12px;
    color: var(--text-light);
}

.message-list {
    flex: 1;
    overflow-y: auto;
}

.message-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f4f8;
    cursor: pointer;
    transition: background 0.1s;
    min-height: 68px;
    position: relative;
}

    .message-row:hover {
        background: #f8fafc;
    }

    .message-row.unread {
        background: var(--unread-bg);
    }

        .message-row.unread:hover {
            background: #e0ecff;
        }

    .message-row.selected {
        background: #dbeafe !important;
        border-left: 3px solid var(--primary);
    }

.msg-check {
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.msg-checkbox {
    cursor: pointer;
}

.msg-star {
    display: flex;
    align-items: center;
    padding-right: 6px;
}

.star {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    transition: color 0.15s;
}

    .star:hover, .star.active {
        color: #f59e0b;
    }

.msg-content {
    flex: 1;
    padding: 10px 10px 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.msg-from {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-row.unread .msg-from {
    color: #0f172a;
}

.msg-subject-preview {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-subject {
    color: var(--text);
    font-weight: 500;
}

.message-row.unread .msg-subject {
    font-weight: 600;
}

.msg-preview {
    color: var(--text-light);
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.msg-date {
    font-size: 11.5px;
    color: var(--text-light);
}

.message-row.unread .msg-date {
    color: var(--primary);
    font-weight: 600;
}

.msg-attach {
    font-size: 12px;
}

.no-messages {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-msg-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

.btn-page {
    padding: 5px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    transition: all 0.15s;
}

    .btn-page:hover:not(:disabled) {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .btn-page:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.page-info {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== MESSAGE VIEW ===== */
.message-view-panel {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.msg-view-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    flex-wrap: wrap;
}

.btn-action {
    padding: 7px 14px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    transition: all 0.15s;
}

    .btn-action:hover {
        background: var(--bg);
        border-color: #cbd5e1;
    }

    .btn-action.btn-danger {
        color: var(--danger);
        border-color: #fecaca;
        background: #fef2f2;
    }

        .btn-action.btn-danger:hover {
            background: #fee2e2;
        }

.msg-view-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.msg-view-subject {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.3;
}

.msg-view-from {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    flex-shrink: 0;
}

.msg-view-sender-info {
    flex: 1;
}

    .msg-view-sender-info strong {
        font-size: 15px;
        color: var(--text);
    }

.from-email {
    font-size: 13px;
    color: var(--text-light);
    margin-left: 6px;
}

.msg-view-to {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 3px;
}

.msg-view-date {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.msg-attachments {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: #fffbeb;
}

.attach-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.attach-item {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 6px;
}

.attach-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.15s;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

    .attach-link:hover {
        background: var(--primary-light);
        border-color: var(--primary);
    }

.msg-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text);
}

    .msg-view-body h1, .msg-view-body h2, .msg-view-body h3 {
        margin-bottom: 12px;
    }

    .msg-view-body p {
        margin-bottom: 10px;
    }

    .msg-view-body ul, .msg-view-body ol {
        margin: 10px 0 10px 24px;
    }

    .msg-view-body li {
        margin-bottom: 4px;
    }

.no-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.no-sel-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-selection p {
    font-size: 15px;
}

/* ===== COMPOSE ===== */
.compose-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

    .compose-header h2 {
        font-size: 17px;
        font-weight: 600;
    }

.compose-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.compose-timer {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-light);
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: white;
    white-space: nowrap;
}

    .compose-timer span {
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

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

.compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.compose-field {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}

    .compose-field label {
        min-width: 80px;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-light);
        padding: 11px 0;
        flex-shrink: 0;
    }

.compose-input {
    flex: 1;
    padding: 11px 8px;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    width: 100%;
}

.select-from {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    padding: 11px 8px;
    cursor: pointer;
    width: 100%;
}

.file-upload {
    flex: 1;
    padding: 8px;
    font-size: 13px;
}

.compose-field-attach {
    flex-wrap: wrap;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    flex-wrap: wrap;
}

    .editor-toolbar button {
        padding: 4px 9px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        color: var(--text);
        transition: all 0.15s;
        font-family: inherit;
        min-width: 30px;
    }

        .editor-toolbar button:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
        }

    .editor-toolbar .sep {
        color: var(--border);
        font-size: 18px;
        margin: 0 2px;
    }

.font-size-sel, .font-color-sel {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    background: white;
    font-family: inherit;
    outline: none;
}

.compose-editor {
    flex: 1;
    padding: 20px;
    min-height: 300px;
    outline: none;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text);
    overflow-y: auto;
}

    .compose-editor:focus {
        background: #fffef9;
    }

.compose-signature {
    padding: 0 20px 16px;
    font-size: 13px;
    color: var(--text-light);
    border-top: 1px dashed var(--border);
    margin-top: 8px;
}

/* ===== CONTACTS ===== */
.contacts-page {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.contacts-sidebar {
    padding: 0;
}

    .contacts-sidebar .folder-item a, .contacts-sidebar .folder-item .LinkButton {
        color: #dbe7ff;
    }

        .contacts-sidebar .folder-item a:hover, .contacts-sidebar .folder-item .LinkButton:hover {
            color: #ffffff;
        }

.contacts-list-panel {
    flex: 1;
    background: var(--bg);
    overflow-y: auto;
}

.contacts-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 360px;
    gap: 16px;
    padding: 16px;
    align-items: start;
}

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

.contact-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 1px solid transparent;
}

    .contact-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 16px rgba(30,106,223,0.1);
        transform: translateY(-1px);
    }

    .contact-card.selected {
        border-color: var(--primary);
        box-shadow: 0 4px 18px rgba(30,106,223,0.16);
    }

.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.contact-email {
    font-size: 12.5px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-company {
    font-size: 12px;
    color: var(--text-light);
}

.contact-meta {
    font-size: 11.5px;
    color: var(--primary);
    margin-top: 4px;
}

.contact-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.contact-btn {
    padding: 5px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s;
    font-family: inherit;
}

    .contact-btn:hover {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
        text-decoration: none;
    }

.contact-btn-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.contact-form-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.contact-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

    .contact-form-header h3 {
        font-size: 16px;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 4px;
    }

.contact-form-subtitle {
    color: var(--text-light);
    font-size: 12.5px;
}

.contact-favorite-field {
    display: flex;
    align-items: center;
    padding-top: 26px;
}

.form-check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .form-check-inline span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .form-check-inline input[type="checkbox"] {
        margin: 0;
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    .form-check-inline label {
        margin: 0;
        font-size: 14px;
        color: var(--text);
        cursor: pointer;
        white-space: nowrap;
    }

.contact-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
}

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

/* ===== SETTINGS ===== */
.settings-page {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.settings-sidebar {
    width: var(--menu-column-width);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    padding: 0;
    overflow-y: auto;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    background: var(--bg);
}

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

.settings-section {
    background: white;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

    .settings-section h3 {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 16px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
    }

.settings-footer {
    display: flex;
    gap: 10px;
    padding-top: 8px;
}

.settings-info-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary);
}

.settings-info-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .settings-info-logo img {
        max-height: 40px;
        max-width: 120px;
        object-fit: contain;
    }

.settings-info-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-info-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.settings-info-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}

    .settings-info-link:hover {
        text-decoration: underline;
    }

.settings-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 8px 0 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 120px;
    gap: 12px;
    align-items: end;
}

.form-row-actions {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.settings-check {
    display: flex;
    align-items: center;
    min-height: 39px;
}

.settings-test-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}

body.theme-dark .settings-section,
body.theme-dark .event-form-panel,
body.theme-dark .contact-card,
body.theme-dark .contact-form-panel,
body.theme-dark .calendar-toolbar,
body.theme-dark .message-list-panel,
body.theme-dark .message-view-panel,
body.theme-dark .toolbar {
    background: #1e293b;
    color: var(--text);
}

body.theme-light .sidebar,
body.theme-light .contacts-sidebar,
body.theme-light .calendar-sidebar,
body.theme-light .settings-sidebar {
    border-right-color: var(--border);
}

    body.theme-light .folder-item a,
    body.theme-light .folder-item .LinkButton,
    body.theme-light .contacts-sidebar .folder-item a,
    body.theme-light .contacts-sidebar .folder-item .LinkButton {
        color: var(--sidebar-text);
    }

        body.theme-light .folder-item a:hover,
        body.theme-light .folder-item .LinkButton:hover,
        body.theme-light .contacts-sidebar .folder-item a:hover,
        body.theme-light .contacts-sidebar .folder-item .LinkButton:hover {
            color: var(--text);
        }

/* ===== CALENDAR ===== */
.calendar-page {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--bg);
}

.calendar-sidebar {
    padding: 0;
}

.calendar-mini {
    margin: 8px 12px 0;
    background: white;
    border-radius: 8px;
    padding: 10px;
}

.mini-calendar {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

    .mini-calendar table {
        width: 100%;
    }

    .mini-calendar td, .mini-calendar th {
        padding: 4px;
        text-align: center;
    }

.calendar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.calendar-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

.calendar-range {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 340px;
    gap: 18px;
    padding: 18px;
    overflow: hidden;
    align-items: start;
}

.calendar-list {
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 160px);
}

.event-list-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.event-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    gap: 14px;
    box-shadow: var(--shadow);
}

.event-date {
    width: 54px;
    height: 58px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.event-month {
    font-size: 11px;
    text-transform: uppercase;
    margin-top: 4px;
}

.event-main {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.event-time {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.event-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.event-description {
    font-size: 13px;
    color: var(--text);
    margin-top: 8px;
    line-height: 1.45;
}

.event-actions {
    display: flex;
    align-items: flex-start;
}

.event-form-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 160px);
    position: sticky;
    top: 0;
}

    .event-form-panel h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--text);
    }

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 900px) {
    .calendar-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .event-form-panel {
        overflow: visible;
    }

    .contacts-workspace {
        grid-template-columns: 1fr;
    }

    .contact-form-panel {
        position: static;
    }

    .form-row-3, .form-row-actions {
        grid-template-columns: 1fr;
    }
}

/* ===== TASKS ===== */
.task-summary {
    margin: 18px 12px 0;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px;
    color: var(--sidebar-text);
}

    .task-summary > div {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        font-size: 13px;
    }

.summary-label {
    color: #94a3b8;
}

.summary-value {
    color: white;
    font-weight: 600;
}

.task-card {
    align-items: flex-start;
}

    .task-card.task-done {
        opacity: 0.7;
    }

        .task-card.task-done .event-title {
            text-decoration: line-through;
            color: var(--text-light);
        }

.task-priority {
    width: 72px;
    text-align: center;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #dcfce7;
    color: #166534;
}

.task-actions {
    flex-direction: column;
    gap: 6px;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .message-view-panel {
        display: none;
    }

    .message-list-panel {
        flex: 1;
        width: auto;
    }
}

@media (max-width: 600px) {
    .sidebar, .contacts-sidebar, .calendar-sidebar {
        width: 0;
        overflow: hidden;
    }

    .global-search-input {
        width: 180px;
    }

    .user-name {
        display: none;
    }
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #000000 100%);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .login-page::before {
        content: "";
        position: absolute;
        width: 1200px;
        height: 1200px;
        background: radial-gradient(circle, rgba(0,150,255,0.25) 0%, transparent 70%);
        top: -300px;
        left: -300px;
        animation: pulse 6s infinite ease-in-out;
        pointer-events: none;
    }

    .login-page::after {
        content: "";
        position: absolute;
        inset: 0;
        background: url('https://grainy-gradients.vercel.app/noise.svg');
        opacity: 0.15;
        pointer-events: none;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.25;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }

    100% {
        transform: scale(1);
        opacity: 0.25;
    }
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}

.c1 {
    width: 600px;
    height: 600px;
    background: #3b82f6;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.c2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -150px;
    left: -100px;
    animation-delay: 2s;
}

.c3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 30%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

.login-container {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

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

.logo-text {
    font-size: 24px;
    font-weight: 300;
    color: #1e293b;
    letter-spacing: -0.5px;
}

    .logo-text strong {
        font-weight: 600;
        color: #3b82f6;
    }

.tagline {
    color: #64748b;
    font-size: 14px;
}

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

    .login-page .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #475569;
        margin-bottom: 6px;
    }

.login-page .form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

    .login-page .form-control:focus {
        border-color: #3b82f6;
        background: white;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    }

.form-row {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
}

.login-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.login-page .btn-primary {
    background: #3b82f6;
    color: white;
}

    .login-page .btn-primary:hover {
        background: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(59,130,246,0.35);
    }

.login-page .btn-block {
    width: 100%;
}

.login-page .alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-page .alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-page .alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

    .login-footer p {
        font-size: 13px;
        color: #94a3b8;
    }

    .login-footer a {
        color: #3b82f6;
        text-decoration: none;
    }

        .login-footer a:hover {
            text-decoration: underline;
        }
