:root {
    --outlook-blue: #0f6cbd;
    --outlook-blue-hover: #0a4a83;
    --outlook-sidebar-bg: #f3f2f1;
    --outlook-sidebar-hover: #e1dfdd;
    --outlook-active-bg: #e1dfdd; /* Often white or light gray depending on theme */
    --outlook-text: #242424;
    --outlook-text-muted: #605e5c;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--outlook-text);
    background-color: #faf9f8;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--outlook-sidebar-bg);
    min-height: 100vh;
    border-right: 1px solid #edebe9;
    padding-top: 15px;
}

.sidebar .brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--outlook-blue);
    padding: 0 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.sidebar .btn-compose {
    background-color: var(--outlook-blue);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    padding: 8px 16px;
    margin: 0 16px 20px 16px;
    display: block;
    text-align: center;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.sidebar .btn-compose:hover {
    background-color: var(--outlook-blue-hover);
    color: white;
}

.sidebar-nav {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--outlook-text);
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    height: 36px;
    transition: background-color 0.15s;
}

.sidebar-nav-link i {
    margin-right: 12px;
    font-size: 16px;
    color: var(--outlook-text-muted);
}

.sidebar-nav-link:hover {
    background-color: var(--outlook-sidebar-hover);
    color: var(--outlook-text);
}

.sidebar-nav-link.active {
    background-color: #ffffff;
    font-weight: 600;
    color: var(--outlook-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sidebar-nav-link.active i {
    color: var(--outlook-blue);
}

/* Tools Section (Bottom of sidebar) */
.sidebar-tools {
    margin-top: 40px;
    border-top: 1px solid #edebe9;
    padding-top: 10px;
}

/* Main Content */
.main-content {
    padding: 20px 30px;
    background-color: #ffffff;
    min-height: 100vh;
}

/* Toolbar */
.mail-toolbar {
    padding: 8px 0;
    border-bottom: 1px solid #edebe9;
    margin-bottom: 16px;
}

.mail-toolbar .btn {
    color: var(--outlook-text);
    font-size: 14px;
    padding: 6px 12px;
    border: none;
    background: transparent;
}

.mail-toolbar .btn:hover {
    background-color: var(--outlook-sidebar-bg);
}

.mail-toolbar .btn i {
    margin-right: 6px;
    color: var(--outlook-blue);
}

/* Table styles */
.table-mail tbody tr {
    cursor: pointer;
    position: relative;
}

.table-mail tbody tr.unread {
    font-weight: 600;
    background-color: #f3f9ff;
}

.table-mail tbody tr:hover {
    background-color: var(--outlook-sidebar-bg);
}

.mail-checkbox-cell {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.mail-checkbox {
    cursor: pointer;
}

/* Hover Quick Actions */
.row-actions {
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    background-color: var(--outlook-sidebar-bg);
}

.table-mail tbody tr:hover .row-actions {
    opacity: 1;
}

.row-actions button {
    background: transparent;
    border: none;
    color: var(--outlook-text-muted);
    padding: 2px 6px;
}

.row-actions button:hover {
    color: var(--outlook-blue);
}

[data-bs-theme="dark"] {
    --outlook-sidebar-bg: #212529;
    --outlook-sidebar-hover: #343a40;
    --outlook-active-bg: #343a40;
    --outlook-text: #f8f9fa;
    --outlook-text-muted: #adb5bd;
}

[data-bs-theme="dark"] body {
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .main-content {
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .sidebar {
    border-right-color: #343a40;
}

[data-bs-theme="dark"] .sidebar-nav-link.active {
    background-color: #2b3035 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .sidebar-tools {
    border-top-color: #343a40;
}

[data-bs-theme="dark"] .mail-toolbar {
    border-bottom-color: #343a40;
}

[data-bs-theme="dark"] .mail-toolbar .btn:hover {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .table-mail tbody tr.unread {
    background-color: #0b233a !important;
}

[data-bs-theme="dark"] .table-mail tbody tr:hover {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .row-actions {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .card {
    background-color: #212529 !important;
    border-color: #343a40 !important;
}

/* Mobile Adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #edebe9;
        padding-bottom: 10px;
    }
    
    .table-mail td {
        white-space: nowrap;
    }
    
    .mail-toolbar .btn {
        padding: 4px 8px;
        font-size: 14px;
    }
}
@media (max-width: 767.98px) {
        /* Mobile Adjustments for table-mail */
    .table-mail, .table-mail tbody, .table-mail tr, .table-mail td { display: block; }
    .table-mail thead { display: none; }
    .table-mail tr {
        border-bottom: 1px solid #edebe9;
        position: relative;
        padding: 12px 10px 12px 40px !important;
        min-height: 80px;
    }
    .table-mail td {
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        text-align: left !important;
        line-height: 1.4;
    }
    .table-mail td.mail-checkbox-cell {
        position: absolute;
        left: 12px;
        top: 15px;
        width: 20px !important;
    }
    .table-mail td:nth-child(2) {
        font-weight: 600;
        font-size: 15px !important;
        margin-bottom: 2px;
        padding-right: 60px !important;
    }
    .table-mail td:nth-child(2) .text-truncate {
        max-width: 100% !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .table-mail td:nth-child(3) {
        color: var(--outlook-text-muted);
        font-size: 14px !important;
    }
    .table-mail td:nth-child(3) .text-truncate {
        max-width: 100% !important;
    }
    .table-mail td:nth-child(4) {
        position: absolute;
        right: 12px;
        top: 36px;
        width: auto !important;
    }
    .table-mail td:nth-child(5) {
        position: absolute;
        right: 12px;
        top: 12px;
        width: auto !important;
        font-size: 13px !important;
        color: var(--outlook-text-muted);
        text-align: right !important;
    }
    .table-mail td:nth-child(5) .date-display { display: block; }
    .row-actions { display: none !important; }
}

