/**
 * RustMail - Outlook 2025 Theme
 * Fluent Design System inspired theme
 */

/* ============================================
   CSS Variables - Fluent Design Tokens
   ============================================ */
:root {
    /* Brand Colors */
    --outlook-blue: #0078D4;
    --outlook-blue-hover: #106EBE;
    --outlook-blue-active: #005A9E;
    --outlook-blue-light: #DEECF9;

    /* Neutral Colors */
    --neutral-0: #000000;
    --neutral-10: #1F1F1F;
    --neutral-20: #292929;
    --neutral-30: #3D3D3D;
    --neutral-40: #5C5C5C;
    --neutral-50: #7A7A7A;
    --neutral-60: #9E9E9E;
    --neutral-70: #BEBEBE;
    --neutral-80: #D6D6D6;
    --neutral-90: #EBEBEB;
    --neutral-95: #F5F5F5;
    --neutral-100: #FFFFFF;

    /* Semantic Colors */
    --success: #107C10;
    --warning: #FFB900;
    --error: #D13438;
    --info: #0078D4;

    /* Surface Colors (Light Mode) */
    --surface: #FFFFFF;
    --surface-secondary: #FAFAFA;
    --surface-tertiary: #F5F5F5;
    --surface-hover: rgba(0, 0, 0, 0.04);
    --surface-active: rgba(0, 0, 0, 0.08);
    --surface-selected: var(--outlook-blue-light);

    /* Text Colors */
    --text-primary: #242424;
    --text-secondary: #616161;
    --text-tertiary: #9E9E9E;
    --text-inverse: #FFFFFF;
    --text-brand: var(--outlook-blue);

    /* Border */
    --border-color: #E0E0E0;
    --border-subtle: #F0F0F0;

    /* Shadow */
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-4: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-8: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-16: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-28: 0 14px 28px rgba(0, 0, 0, 0.16);

    /* Layout */
    --rail-width: 48px;
    --sidebar-width: 220px;
    --sidebar-collapsed: 0px;
    --list-width: 360px;
    --header-height: 48px;
    --compose-width: 600px;

    /* Typography */
    --font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-caption: 11px;
    --font-size-body-2: 12px;
    --font-size-body-1: 14px;
    --font-size-subtitle: 16px;
    --font-size-title: 20px;
    --font-size-headline: 24px;

    /* Spacing */
    --spacing-xxs: 2px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-round: 9999px;

    /* Transitions */
    --transition-fast: 100ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Mode - Fluent 2 Design Tokens (New Outlook 2025) */
[data-theme="dark"] {
    /* Surface hierarchy: main → sidebar → rail (progressively darker) */
    --surface: #292929;
    --surface-secondary: #1f1f1f;
    --surface-tertiary: #141414;
    --surface-hover: rgba(255, 255, 255, 0.06);
    --surface-active: rgba(255, 255, 255, 0.09);
    --surface-selected: rgba(0, 120, 212, 0.20);

    /* Foreground hierarchy */
    --text-primary: #FFFFFF;
    --text-secondary: #C8C8C8;
    --text-tertiary: #999999;

    /* Stroke hierarchy */
    --border-color: #404040;
    --border-subtle: #333333;

    /* Outlook blue adjustments for dark */
    --outlook-blue-light: rgba(0, 120, 212, 0.16);

    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.32);
    --shadow-4: 0 2px 4px rgba(0, 0, 0, 0.32);
    --shadow-8: 0 4px 8px rgba(0, 0, 0, 0.36);
    --shadow-16: 0 8px 16px rgba(0, 0, 0, 0.40);
    --shadow-28: 0 14px 28px rgba(0, 0, 0, 0.48);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
}

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

a:hover {
    text-decoration: underline;
}

/* ============================================
   App Container
   ============================================ */
.outlook-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   Left Rail (Icon Navigation)
   ============================================ */
.outlook-rail {
    display: flex;
    flex-direction: column;
    width: var(--rail-width);
    background: var(--surface-tertiary);
    border-right: none;
    flex-shrink: 0;
    z-index: 100;
}

.outlook-rail__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    gap: 2px;
}

.outlook-rail__bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    gap: 2px;
}

.outlook-rail__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    border: none;
    background: transparent;
}

.outlook-rail__item .md-icon,
.outlook-rail__item .material-icons {
    font-size: 20px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

.outlook-rail__item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.outlook-rail__item--active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--outlook-blue);
}

.outlook-rail__item--active .md-icon,
.outlook-rail__item--active .material-icons {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* Pill indicator on active rail item */
.outlook-rail__item--active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--outlook-blue);
    border-radius: 3px;
}

.outlook-rail__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
}

.outlook-rail__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--outlook-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-body-2);
    font-weight: 500;
    cursor: pointer;
}

/* ============================================
   Main Container
   ============================================ */
.outlook-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    background: var(--surface);
}

/* ============================================
   Header / Toolbar - New Outlook Dark Blue Bar
   ============================================ */
.outlook-header {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    background: #0F6CBD;
    border-bottom: none;
    gap: 12px;
    flex-shrink: 0;
}

[data-theme="dark"] .outlook-header {
    background: #1B3A5C;
}

.outlook-header__title {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.outlook-header__search {
    flex: 1;
    max-width: 480px;
    position: relative;
    margin: 0 auto;
}

.outlook-header__search-input {
    width: 100%;
    height: 34px;
    padding: 0 14px;
    padding-left: 34px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-round);
    font-size: 13px;
    color: #FFFFFF;
    transition: all 0.2s ease;
}

.outlook-header__search-input:focus {
    outline: none;
    background: #FFFFFF;
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.outlook-header__search-input:focus::placeholder {
    color: var(--text-tertiary);
}

.outlook-header__search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.outlook-header__search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    pointer-events: none;
}

.outlook-header__search-input:focus ~ .outlook-header__search-icon {
    color: var(--text-tertiary);
}

.outlook-header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: auto;
}

.outlook-header__actions .outlook-btn {
    color: rgba(255, 255, 255, 0.85);
}

.outlook-header__actions .outlook-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
}

.outlook-header__actions .material-icons {
    color: rgba(255, 255, 255, 0.85);
}

/* Search clear button in header */
.outlook-header__search-clear {
    color: rgba(255, 255, 255, 0.7);
}

.outlook-header__search-input:focus ~ .outlook-header__search-clear {
    color: var(--text-tertiary);
}

/* ============================================
   Action Toolbar (Ribbon) - Outlook 2025 Style
   ============================================ */
.outlook-action-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 40px;
    flex-shrink: 0;
}

.outlook-action-toolbar__group {
    display: flex;
    align-items: center;
    gap: 1px;
}

.outlook-action-toolbar__divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 6px;
    opacity: 0.5;
}

.outlook-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    min-height: 30px;
}

.outlook-action-btn:hover:not(:disabled) {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.outlook-action-btn:active:not(:disabled) {
    background: var(--surface-active);
    transform: scale(0.98);
}

.outlook-action-btn:focus-visible {
    outline: 2px solid var(--outlook-blue);
    outline-offset: 1px;
}

.outlook-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--text-tertiary);
}

.outlook-action-btn .material-icons,
.outlook-action-btn .md-icon {
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.1s ease;
}

.outlook-action-btn:hover:not(:disabled) .material-icons,
.outlook-action-btn:hover:not(:disabled) .md-icon {
    color: var(--text-primary);
}

/* Primary button (New/Neu) - Outlook pill style */
.outlook-action-btn--primary {
    background: var(--outlook-blue);
    color: white;
    border-color: var(--outlook-blue);
    border-radius: var(--radius-round);
    padding: 5px 16px;
    font-weight: 600;
    font-size: 13px;
    min-height: 30px;
}

.outlook-action-btn--primary .material-icons,
.outlook-action-btn--primary .md-icon {
    color: white;
    font-size: 16px;
}

.outlook-action-btn--primary:hover:not(:disabled) {
    background: var(--outlook-blue-hover);
    border-color: var(--outlook-blue-hover);
    color: white;
}

.outlook-action-btn--primary:active:not(:disabled) {
    background: var(--outlook-blue-active);
}

.outlook-action-btn--primary:hover:not(:disabled) .material-icons,
.outlook-action-btn--primary:hover:not(:disabled) .md-icon {
    color: white;
}

/* Icon-only buttons */
.outlook-action-btn--icon {
    padding: 6px;
    min-width: 30px;
    min-height: 30px;
}

.outlook-action-btn--icon .material-icons,
.outlook-action-btn--icon .md-icon {
    font-size: 18px;
}

/* Danger button (Delete) */
.outlook-action-btn--danger:hover:not(:disabled) {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
}

.outlook-action-btn--danger:hover:not(:disabled) .material-icons {
    color: #dc3545;
}

/* Active state (for toggle buttons like calendar view) */
.outlook-action-btn--active {
    background: rgba(0, 120, 212, 0.12);
    border-color: rgba(0, 120, 212, 0.3);
    color: var(--outlook-blue);
}

.outlook-action-btn--active .material-icons {
    color: var(--outlook-blue);
}

/* View-specific toolbars */
.outlook-action-toolbar[data-view] {
    display: none;
}

.outlook-action-toolbar[data-view].active {
    display: flex;
}

/* Hide text labels on smaller screens */
@media (max-width: 1100px) {
    .outlook-action-btn:not(.outlook-action-btn--primary) span:not(.material-icons) {
        display: none;
    }
    .outlook-action-btn:not(.outlook-action-btn--primary) {
        padding: 8px 10px;
    }
}

@media (max-width: 900px) {
    .outlook-action-btn--primary span:not(.material-icons) {
        display: none;
    }
    .outlook-action-btn--primary {
        padding: 8px 12px;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .outlook-action-toolbar {
    background: var(--surface-secondary);
}

[data-theme="dark"] .outlook-action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
}

[data-theme="dark"] .outlook-action-btn:hover:not(:disabled) .material-icons,
[data-theme="dark"] .outlook-action-btn:hover:not(:disabled) .md-icon {
    color: var(--text-primary);
}

/* Dark mode message hover actions */
[data-theme="dark"] .sg-message__hover-actions {
    background: var(--surface-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Content Area
   ============================================ */
.outlook-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ============================================
   Folder Pane / Sidebar
   ============================================ */
.outlook-folders {
    width: var(--sidebar-width);
    background: var(--surface-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.outlook-folders--collapsed {
    width: 0;
}

.outlook-folders__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    min-height: 32px;
}

.outlook-folders__title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outlook-folders__list {
    flex: 1;
    overflow-y: auto;
    padding: 2px 6px;
}

.outlook-folder {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    transition: background 0.15s ease;
    gap: 8px;
    margin: 1px 0;
    position: relative;
}

.outlook-folder:hover {
    background: var(--surface-hover);
}

.outlook-folder--active {
    background: rgba(0, 120, 212, 0.12);
    color: var(--outlook-blue);
    font-weight: 600;
}

.outlook-folder--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--outlook-blue);
    border-radius: 0 2px 2px 0;
}

.outlook-folder__icon {
    font-size: 18px;
    color: var(--text-tertiary);
}

.outlook-folder--active .outlook-folder__icon {
    color: var(--outlook-blue);
}

.outlook-folder__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outlook-folder__count {
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 16px;
    text-align: right;
}

.outlook-folder--unread .outlook-folder__count {
    color: var(--outlook-blue);
    font-weight: 600;
}

/* Nested folders */
.outlook-folder--nested {
    padding-left: calc(var(--spacing-md) + 24px);
}

.outlook-folder--nested-2 {
    padding-left: calc(var(--spacing-md) + 48px);
}

/* ============================================
   Message List
   ============================================ */
.outlook-list {
    width: var(--list-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border-subtle);
    flex-shrink: 0;
    overflow: hidden;
}

.outlook-list__header {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    gap: 8px;
    flex-shrink: 0;
    min-height: 38px;
}

.outlook-list__toolbar {
    display: flex;
    align-items: center;
    padding: 4px 14px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 6px;
    flex-shrink: 0;
    background: var(--surface);
}

.outlook-list__filter {
    display: flex;
    align-items: center;
    gap: 4px;
}

.outlook-list__filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-round);
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s ease;
}

.outlook-list__filter-btn:hover {
    background: var(--surface-hover);
    color: var(--text-secondary);
}

.outlook-list__filter-btn--active {
    background: var(--outlook-blue);
    color: white;
    font-weight: 600;
}

.outlook-list__content {
    flex: 1;
    overflow-y: auto;
}

.outlook-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-tertiary);
}

.outlook-list__empty-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

/* Message Item */
.outlook-message {
    display: flex;
    padding: 10px 14px;
    margin: 1px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.outlook-message:hover {
    background: var(--surface-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.outlook-message--active {
    background: var(--surface-selected);
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.15);
}

.outlook-message--unread {
    background: rgba(255, 255, 255, 0.03);
}

.outlook-message--unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: var(--spacing-md);
    bottom: var(--spacing-md);
    width: 3px;
    background: var(--outlook-blue);
    border-radius: 0 2px 2px 0;
}

.outlook-message__checkbox {
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.outlook-message__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--neutral-80);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-body-1);
    font-weight: 500;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
}

.outlook-message__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.outlook-message__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xxs);
}

.outlook-message__sender {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.outlook-message--unread .outlook-message__sender {
    font-weight: 700;
}

.outlook-message__date {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.outlook-message__subject {
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: var(--spacing-xxs);
}

.outlook-message--unread .outlook-message__subject {
    font-weight: 500;
}

.outlook-message__preview {
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outlook-message__flags {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    margin-left: var(--spacing-sm);
}

.outlook-message__flag {
    font-size: 16px;
    color: var(--text-tertiary);
}

.outlook-message__flag--attachment {
    color: var(--text-secondary);
}

.outlook-message__flag--flagged {
    color: var(--error);
}

.outlook-message__flag--pinned {
    color: var(--outlook-blue);
}

/* ============================================
   Reading Pane / Preview
   ============================================ */
.outlook-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    min-width: 0;
    overflow: hidden;
}

.outlook-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.outlook-preview__empty {
    text-align: center;
    color: var(--text-tertiary);
}

.outlook-preview__empty-icon {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.3;
}

.outlook-preview__empty-text {
    font-size: var(--font-size-subtitle);
}

.outlook-preview__header {
    padding: 20px 24px 16px;
    border-bottom: none;
    flex-shrink: 0;
}

.outlook-preview__subject {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.outlook-preview__meta {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.outlook-preview__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--outlook-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.outlook-preview__sender-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xxs);
}

.outlook-preview__sender-email {
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.outlook-preview__recipients {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
}

.outlook-preview__date {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.outlook-preview__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.outlook-preview__content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.outlook-preview__body {
    font-size: var(--font-size-body-1);
    line-height: 1.6;
    color: var(--text-primary);
}

.outlook-preview__body img {
    max-width: 100%;
    height: auto;
}

.outlook-preview__attachments {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
}

.outlook-preview__attachments-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-body-2);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.outlook-preview__attachment {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-2);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-right: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.outlook-preview__attachment:hover {
    border-color: var(--outlook-blue);
    background: var(--surface-hover);
}

/* ============================================
   Compose Window
   ============================================ */
.outlook-compose {
    position: fixed;
    bottom: 0;
    right: var(--spacing-xl);
    width: var(--compose-width);
    max-width: calc(100vw - 100px);
    background: var(--surface);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    max-height: 80vh;
}

.outlook-compose--active {
    transform: translateY(0);
}

.outlook-compose--minimized {
    transform: translateY(calc(100% - 48px));
}

.outlook-compose--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: translateY(0);
}

/* Compose in Preview Area (Inline Reply) */
.outlook-compose--inline {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    border-top: 1px solid var(--border-color);
    max-height: 50%;
    flex-shrink: 0;
}

.outlook-compose__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--outlook-blue);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.outlook-compose--fullscreen .outlook-compose__header,
.outlook-compose--inline .outlook-compose__header {
    border-radius: 0;
}

.outlook-compose__title {
    font-size: var(--font-size-body-1);
    font-weight: 500;
    flex: 1;
}

.outlook-compose__header-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.outlook-compose__header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.outlook-compose__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.outlook-compose__fields {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.outlook-compose__field {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.outlook-compose__field:last-child {
    margin-bottom: 0;
}

.outlook-compose__field-label {
    width: 60px;
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.outlook-compose__field-input {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    background: transparent;
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    outline: none;
}

.outlook-compose__field-input::placeholder {
    color: var(--text-tertiary);
}

.outlook-compose__editor {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.outlook-compose__editor-content {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    font-size: var(--font-size-body-1);
    line-height: 1.6;
    color: var(--text-primary);
    outline: none;
}

.outlook-compose__editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
}

.outlook-compose__attachments {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.outlook-compose__attachment {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-2);
}

.outlook-compose__attachment-remove {
    cursor: pointer;
    color: var(--text-tertiary);
}

.outlook-compose__attachment-remove:hover {
    color: var(--error);
}

.outlook-compose__toolbar {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.outlook-compose__toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 var(--spacing-sm);
}

/* ============================================
   Buttons
   ============================================ */
.outlook-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-1);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

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

.outlook-btn--primary:active {
    background: var(--outlook-blue-active);
}

.outlook-btn--secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
}

.outlook-btn--secondary:hover {
    background: var(--surface-hover);
}

.outlook-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.outlook-btn--ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.outlook-btn--icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
}

.outlook-btn--icon-sm {
    width: 28px;
    height: 28px;
}

/* ============================================
   Checkbox
   ============================================ */
.outlook-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.1s ease;
    flex-shrink: 0;
}

.outlook-checkbox:hover {
    border-color: var(--outlook-blue);
}

.outlook-checkbox--checked {
    background: var(--outlook-blue);
    border-color: var(--outlook-blue);
}

.outlook-checkbox--checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* ============================================
   Loading Spinner
   ============================================ */
.outlook-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--outlook-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.outlook-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

/* ============================================
   Dropdown / Menu
   ============================================ */
.outlook-menu {
    position: absolute;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.04);
    padding: 4px 0;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition-fast);
}

.outlook-menu--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.outlook-menu__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 6px;
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s ease;
    border: none;
    background: transparent;
    width: calc(100% - 8px);
    text-align: left;
}

.outlook-menu__item:hover {
    background: var(--surface-hover);
}

.outlook-menu__item--danger {
    color: var(--error);
}

.outlook-menu__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-xs) 0;
}

/* ============================================
   Modal / Dialog
   ============================================ */
.outlook-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.outlook-modal--visible {
    opacity: 1;
    visibility: visible;
}

.outlook-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.outlook-modal__content {
    position: relative;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.outlook-modal--visible .outlook-modal__content {
    transform: scale(1);
}

.outlook-modal__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.outlook-modal__title {
    font-size: var(--font-size-subtitle);
    font-weight: 600;
    flex: 1;
}

.outlook-modal__body {
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.outlook-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   Toast / Snackbar
   ============================================ */
.outlook-toast {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--neutral-20);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-16);
    z-index: 3000;
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.outlook-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.outlook-toast--success {
    background: var(--success);
}

.outlook-toast--error {
    background: var(--error);
}

/* ============================================
   Calendar View - Outlook 2025 Style
   ============================================ */

/* Calendar Sidebar */
.outlook-calendar-sidebar {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.outlook-calendar-sidebar__mini {
    margin-bottom: var(--spacing-lg);
}

.outlook-calendar-sidebar__section {
    margin-bottom: var(--spacing-lg);
}

.outlook-calendar-sidebar__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
}

.outlook-calendar-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* Main Calendar */
.outlook-calendar {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    overflow: hidden;
    background: var(--surface);
}

.outlook-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
}

.outlook-calendar__nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.outlook-calendar__nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-calendar__nav-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.outlook-calendar__nav-btn:active {
    transform: scale(0.95);
}

.outlook-calendar__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 180px;
}

.outlook-calendar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.outlook-calendar__grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.outlook-calendar__day-header {
    padding: var(--spacing-sm);
    text-align: center;
    font-size: var(--font-size-body-2);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-secondary);
}

.outlook-calendar__day {
    min-height: 100px;
    padding: var(--spacing-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.outlook-calendar__day:hover {
    background: rgba(0, 120, 212, 0.04);
    box-shadow: inset 0 0 0 1px rgba(0, 120, 212, 0.2);
}

.outlook-calendar__day--today {
    background: rgba(0, 120, 212, 0.08);
}

.outlook-calendar__day--today:hover {
    background: rgba(0, 120, 212, 0.12);
}

.outlook-calendar__day--selected {
    background: rgba(0, 120, 212, 0.12);
    box-shadow: inset 0 0 0 2px var(--outlook-blue);
}

.outlook-calendar__day-number {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.outlook-calendar__day--today .outlook-calendar__day-number {
    background: var(--outlook-blue);
    color: white;
    font-weight: 600;
}

.outlook-calendar__day:hover .outlook-calendar__day-number:not(.outlook-calendar__day--today .outlook-calendar__day-number) {
    background: rgba(0, 0, 0, 0.05);
}

.outlook-calendar__event {
    padding: 4px 8px;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 5px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.15) 0%, rgba(0, 120, 212, 0.1) 100%);
    color: var(--outlook-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-left: 3px solid var(--outlook-blue);
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-calendar__event:hover {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.25) 0%, rgba(0, 120, 212, 0.15) 100%);
    box-shadow: 0 1px 4px rgba(0, 120, 212, 0.15);
}

/* Calendar Event Colors */
.outlook-calendar__event--green {
    background: linear-gradient(135deg, rgba(16, 124, 16, 0.15) 0%, rgba(16, 124, 16, 0.1) 100%);
    color: #107C10;
    border-left-color: #107C10;
}

.outlook-calendar__event--red {
    background: linear-gradient(135deg, rgba(196, 49, 75, 0.15) 0%, rgba(196, 49, 75, 0.1) 100%);
    color: #C4314B;
    border-left-color: #C4314B;
}

.outlook-calendar__event--purple {
    background: linear-gradient(135deg, rgba(117, 56, 140, 0.15) 0%, rgba(117, 56, 140, 0.1) 100%);
    color: #75388C;
    border-left-color: #75388C;
}

.outlook-calendar__event--orange {
    background: linear-gradient(135deg, rgba(202, 80, 16, 0.15) 0%, rgba(202, 80, 16, 0.1) 100%);
    color: #CA5010;
    border-left-color: #CA5010;
}

/* ============================================
   Contacts View - Outlook 2025 Style
   ============================================ */
.outlook-contacts {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--surface);
}

.outlook-contacts__list {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.outlook-contacts__search {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
}

.outlook-contacts__search-input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.outlook-contacts__search-input:focus {
    outline: none;
    border-color: var(--outlook-blue);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.outlook-contacts__search-input::placeholder {
    color: var(--text-tertiary);
}

.outlook-contacts__items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xs) 0;
}

.outlook-contacts__group {
    margin-bottom: var(--spacing-sm);
}

.outlook-contacts__group-header {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.outlook-contacts__detail {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, var(--surface-secondary) 0%, var(--surface) 200px);
}

.outlook-contacts__detail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    gap: var(--spacing-md);
}

.outlook-contacts__detail-empty .material-icons {
    font-size: 64px;
    opacity: 0.3;
}

.outlook-contact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    margin: 2px 8px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.outlook-contact:hover {
    background: rgba(0, 120, 212, 0.06);
    border-color: rgba(0, 120, 212, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.outlook-contact--active {
    background: rgba(0, 120, 212, 0.1);
    border-color: rgba(0, 120, 212, 0.18);
    box-shadow: 0 1px 4px rgba(0, 120, 212, 0.1);
}

.outlook-contact--active:hover {
    background: rgba(0, 120, 212, 0.14);
}

.outlook-contact__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--outlook-blue) 0%, #005a9e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.25);
    transition: all 0.2s ease;
}

.outlook-contact:hover .outlook-contact__avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.35);
}

/* Avatar color variations */
.outlook-contact__avatar--green {
    background: linear-gradient(135deg, #107C10 0%, #0B5E0B 100%);
    box-shadow: 0 2px 8px rgba(16, 124, 16, 0.25);
}

.outlook-contact__avatar--purple {
    background: linear-gradient(135deg, #75388C 0%, #5B2D6E 100%);
    box-shadow: 0 2px 8px rgba(117, 56, 140, 0.25);
}

.outlook-contact__avatar--orange {
    background: linear-gradient(135deg, #CA5010 0%, #A04010 100%);
    box-shadow: 0 2px 8px rgba(202, 80, 16, 0.25);
}

.outlook-contact__avatar--red {
    background: linear-gradient(135deg, #C4314B 0%, #9E2840 100%);
    box-shadow: 0 2px 8px rgba(196, 49, 75, 0.25);
}

.outlook-contact__avatar--teal {
    background: linear-gradient(135deg, #008272 0%, #006458 100%);
    box-shadow: 0 2px 8px rgba(0, 130, 114, 0.25);
}

.outlook-contact__info {
    flex: 1;
    min-width: 0;
}

.outlook-contact__name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.outlook-contact__email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outlook-contact__company {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Contact Detail Card */
.outlook-contact-card {
    width: 100%;
    max-width: 500px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.outlook-contact-card__header {
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--outlook-blue) 0%, #005a9e 100%);
    color: white;
    text-align: center;
}

.outlook-contact-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 500;
    margin: 0 auto var(--spacing-md);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.outlook-contact-card__name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.outlook-contact-card__title {
    font-size: 14px;
    opacity: 0.9;
}

.outlook-contact-card__body {
    padding: var(--spacing-lg);
}

.outlook-contact-card__section {
    margin-bottom: var(--spacing-lg);
}

.outlook-contact-card__section:last-child {
    margin-bottom: 0;
}

.outlook-contact-card__section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.outlook-contact-card__field {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.outlook-contact-card__field:last-child {
    border-bottom: none;
}

.outlook-contact-card__field-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.outlook-contact-card__field-icon .material-icons {
    font-size: 18px;
}

.outlook-contact-card__field-content {
    flex: 1;
}

.outlook-contact-card__field-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.outlook-contact-card__field-value {
    font-size: 14px;
    color: var(--text-primary);
}

.outlook-contact-card__field-value a {
    color: var(--outlook-blue);
    text-decoration: none;
}

.outlook-contact-card__field-value a:hover {
    text-decoration: underline;
}

.outlook-contact-card__actions {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface-secondary);
    border-top: 1px solid var(--border-subtle);
}

.outlook-contact-card__action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-contact-card__action:hover {
    background: var(--surface-hover);
    color: var(--outlook-blue);
}

.outlook-contact-card__action .material-icons {
    font-size: 20px;
}

/* Calendar Grid (Month View) - Enhanced */
.outlook-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-color);
}

.outlook-calendar__weekdays span {
    padding: 12px var(--spacing-sm);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.outlook-calendar__days {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.outlook-calendar__week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 110px;
    border-bottom: 1px solid var(--border-subtle);
}

.outlook-calendar__week:last-child {
    border-bottom: none;
}

.outlook-calendar__day {
    padding: var(--spacing-sm);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    min-height: 110px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.outlook-calendar__day:hover {
    background: rgba(0, 120, 212, 0.04);
}

.outlook-calendar__day:last-child {
    border-right: none;
}

.outlook-calendar__day--other {
    background: var(--surface-secondary);
}

.outlook-calendar__day--other:hover {
    background: rgba(0, 0, 0, 0.03);
}

.outlook-calendar__day--other .outlook-calendar__day-num {
    color: var(--text-tertiary);
}

.outlook-calendar__day--today {
    background: rgba(0, 120, 212, 0.06);
}

.outlook-calendar__day--today:hover {
    background: rgba(0, 120, 212, 0.1);
}

.outlook-calendar__day-num {
    font-size: 13px;
    font-weight: 500;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: var(--spacing-xs);
    transition: all 0.15s ease;
}

.outlook-calendar__day--today .outlook-calendar__day-num {
    background: var(--outlook-blue);
    color: white;
    font-weight: 600;
}

.outlook-calendar__day:hover:not(.outlook-calendar__day--today) .outlook-calendar__day-num {
    background: rgba(0, 0, 0, 0.05);
}

.outlook-calendar__events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.outlook-calendar__more {
    font-size: 11px;
    font-weight: 500;
    color: var(--outlook-blue);
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.outlook-calendar__more:hover {
    background: rgba(0, 120, 212, 0.1);
}

/* Calendar Mini (Sidebar) */
.outlook-calendar-mini {
    padding: var(--spacing-md);
}

.outlook-calendar-mini__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.outlook-calendar-mini__title {
    font-size: 14px;
    font-weight: 600;
}

.outlook-calendar-mini__nav {
    display: flex;
    gap: 4px;
}

.outlook-calendar-mini__nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-calendar-mini__nav-btn:hover {
    background: var(--surface-hover);
}

.outlook-calendar-mini__nav-btn .material-icons {
    font-size: 18px;
}

.outlook-calendar-mini__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.outlook-calendar-mini__weekday {
    padding: 4px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.outlook-calendar-mini__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-calendar-mini__day:hover {
    background: var(--surface-hover);
}

.outlook-calendar-mini__day--other {
    color: var(--text-tertiary);
}

.outlook-calendar-mini__day--today {
    background: var(--outlook-blue);
    color: white;
    font-weight: 600;
}

.outlook-calendar-mini__day--selected {
    background: rgba(0, 120, 212, 0.15);
    color: var(--outlook-blue);
    font-weight: 600;
}

.outlook-calendar-mini__day--has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--outlook-blue);
    border-radius: 50%;
}

/* Contacts Extended */
.outlook-contacts__toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
}

.outlook-contacts__toolbar .outlook-input {
    flex: 1;
}

/* Contacts Empty State */
.outlook-contacts__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
    text-align: center;
}

.outlook-contacts__empty-icon {
    font-size: 64px !important;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.outlook-contacts__empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.outlook-contacts__empty-text {
    font-size: 13px;
    max-width: 280px;
}

/* Contact List Loading */
.outlook-contacts__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

/* Contact Detail View */
.outlook-contact-detail {
    width: 100%;
    max-width: 600px;
}

.outlook-contact-detail__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.08) 0%, rgba(0, 120, 212, 0.02) 100%);
    border-radius: 16px;
    margin-bottom: var(--spacing-lg);
}

.outlook-contact-detail__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--outlook-blue) 0%, #005a9e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 500;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.3);
}

.outlook-contact-detail__info {
    flex: 1;
}

.outlook-contact-detail__name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.outlook-contact-detail__title {
    font-size: 14px;
    color: var(--text-secondary);
}

.outlook-contact-detail__actions {
    display: flex;
    gap: var(--spacing-sm);
}

.outlook-contact-detail__action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-contact-detail__action:hover {
    background: var(--outlook-blue);
    border-color: var(--outlook-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.outlook-contact-detail__section {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}

.outlook-contact-detail__section-title {
    padding: var(--spacing-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.outlook-contact-detail__field {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

.outlook-contact-detail__field:last-child {
    border-bottom: none;
}

.outlook-contact-detail__field:hover {
    background: var(--surface-hover);
}

.outlook-contact-detail__field-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 120, 212, 0.08);
    border-radius: 8px;
    color: var(--outlook-blue);
    flex-shrink: 0;
}

.outlook-contact-detail__field-icon .material-icons {
    font-size: 18px;
}

.outlook-contact-detail__field-content {
    flex: 1;
    min-width: 0;
}

.outlook-contact-detail__field-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.outlook-contact-detail__field-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.outlook-contact-detail__field-value a {
    color: var(--outlook-blue);
    text-decoration: none;
}

.outlook-contact-detail__field-value a:hover {
    text-decoration: underline;
}

.outlook-contact-detail__field-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.outlook-contact-detail__field:hover .outlook-contact-detail__field-action {
    opacity: 1;
}

.outlook-contact-detail__field-action:hover {
    background: var(--surface-hover);
    color: var(--outlook-blue);
}

.outlook-contact-detail__field-action .material-icons {
    font-size: 18px;
}

.outlook-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-1);
    background: var(--surface);
    color: var(--text-primary);
}

.outlook-input:focus {
    outline: none;
    border-color: var(--outlook-blue);
    box-shadow: 0 0 0 2px var(--outlook-blue-light);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .outlook-folders {
        width: 180px;
    }

    .outlook-list {
        width: 300px;
    }
}

@media (max-width: 900px) {
    .outlook-folders {
        position: fixed;
        left: var(--rail-width);
        top: 0;
        bottom: 0;
        width: var(--sidebar-width);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .outlook-folders--open {
        transform: translateX(0);
    }

    .outlook-list {
        flex: 1;
        width: auto;
    }

    .outlook-preview {
        position: fixed;
        inset: 0;
        left: var(--rail-width);
        z-index: 150;
        transform: translateX(100%);
        transition: transform var(--transition-normal);
    }

    .outlook-preview--open {
        transform: translateX(0);
    }

    .outlook-compose {
        left: var(--rail-width);
        right: 0;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .outlook-rail {
        width: 56px;
    }

    .outlook-header__search {
        display: none;
    }

    .outlook-compose--fullscreen {
        left: 0;
    }
}

/* ============================================
   Calendar Responsive
   ============================================ */
@media (max-width: 1200px) {
    .outlook-calendar-sidebar {
        width: 200px;
        min-width: 200px;
    }
}

@media (max-width: 900px) {
    .outlook-calendar-sidebar {
        position: fixed;
        left: var(--rail-width);
        top: 0;
        bottom: 0;
        width: 240px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-16);
    }

    .outlook-calendar-sidebar--open {
        transform: translateX(0);
    }

    /* Calendar toggle button on mobile */
    .outlook-calendar__sidebar-toggle {
        display: flex;
    }

    .outlook-calendar__header {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .outlook-calendar__title {
        min-width: auto;
        font-size: 18px;
    }

    .outlook-calendar__day {
        min-height: 80px;
    }

    .sg-mini-cal__day {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .outlook-calendar {
        padding: var(--spacing-sm);
    }

    .outlook-calendar__header {
        margin-bottom: var(--spacing-sm);
    }

    .outlook-calendar__title {
        font-size: 16px;
    }

    .outlook-calendar__day {
        min-height: 60px;
        padding: var(--spacing-xs);
    }

    .outlook-calendar__day-num {
        font-size: 11px;
    }

    .outlook-calendar__event {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* ============================================
   Contacts Responsive
   ============================================ */
@media (max-width: 900px) {
    .outlook-contacts {
        flex-direction: column;
    }

    .outlook-contacts__list {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .outlook-contacts__detail {
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .outlook-contacts__list {
        max-height: 35vh;
    }

    .sg-contacts__contact {
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .sg-contacts__avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .sg-contacts__name {
        font-size: 13px;
    }

    .sg-contacts__email {
        font-size: 11px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.text-muted {
    color: var(--text-tertiary);
}

.text-primary {
    color: var(--text-primary);
}

.text-brand {
    color: var(--outlook-blue);
}

/* Material Symbols Outlined - Fluent-like outlined icons */
.material-icons,
.md-icon {
    font-family: 'Material Symbols Outlined', 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

.material-icons.md-18, .md-icon.md-18 { font-size: 18px; font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 18; }
.material-icons.md-20, .md-icon.md-20 { font-size: 20px; font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20; }
.material-icons.md-24, .md-icon.md-24 { font-size: 24px; font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }

/* ============================================
   Compatibility Layer for Legacy sg-* Classes
   ============================================ */

/* Folder Tree (generated by JavaScript) */
.sg-folder-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sg-folder {
    list-style: none;
}

.sg-folder__item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    gap: 8px;
    margin: 1px 4px;
    position: relative;
}

.sg-folder__item:hover {
    background: var(--surface-hover);
}

.sg-folder__item--active,
.sg-folder__item.active {
    background: rgba(0, 120, 212, 0.12);
    color: var(--outlook-blue);
    font-weight: 600;
}

.sg-folder__item--active::before,
.sg-folder__item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--outlook-blue);
    border-radius: 0 2px 2px 0;
}

.sg-folder__item--drop-target {
    background: var(--outlook-blue-light);
    outline: 2px dashed var(--outlook-blue);
}

.sg-folder__icon {
    font-size: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

/* Special folder icons - Outlook-style colors */
.sg-folder--inbox .sg-folder__icon { color: #0078D4; }
.sg-folder--sent .sg-folder__icon { color: #498205; }
.sg-folder--drafts .sg-folder__icon { color: #CA5010; }
.sg-folder--trash .sg-folder__icon { color: #D13438; }
.sg-folder--spam .sg-folder__icon { color: #FF8C00; }
.sg-folder--archive .sg-folder__icon { color: #7F85F5; }

.sg-folder__item--active .sg-folder__icon,
.sg-folder__item.active .sg-folder__icon,
.sg-folder__item--active .md-icon,
.sg-folder__item.active .md-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.sg-folder__item--active .sg-folder__icon,
.sg-folder__item.active .sg-folder__icon {
    color: var(--outlook-blue);
}

.sg-folder__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-folder__count,
.sg-folder__unread {
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 16px;
    text-align: right;
}

.sg-folder__count--unread,
.sg-folder__unread:not(:empty) {
    color: var(--outlook-blue);
    font-weight: 600;
}

.sg-folder-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-sm) var(--spacing-md);
}

.sg-folder__children {
    list-style: none;
    padding-left: var(--spacing-lg);
    margin: 0;
    display: none;
}

/* Show children when folder is expanded */
.sg-folder--expanded > .sg-folder__children {
    display: block;
}

/* Rotate expand chevron when expanded */
.sg-folder--expanded > .sg-folder__item .sg-folder__expand .md-icon {
    transform: rotate(90deg);
}

.sg-folder__expand .md-icon {
    transition: transform 0.15s ease;
}

.sg-folder__toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* External Account Folders */
.sg-external-account {
    margin-top: var(--spacing-sm);
}

.sg-external-account__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    gap: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.sg-external-account__header:hover {
    background: var(--surface-hover);
}

.sg-external-account__folders {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Message List Items (generated by JavaScript) - New Outlook 2025 compact style */
.sg-message {
    display: flex;
    align-items: flex-start;
    padding: 10px 14px 10px 10px;
    margin: 1px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    gap: 0;
}

.sg-message:hover {
    background: var(--surface-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sg-message--active,
.sg-message.active {
    background: var(--surface-selected);
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.15);
}

.sg-message--unread {
    background: rgba(255, 255, 255, 0.03);
}

.sg-message--unread::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--outlook-blue);
    border-radius: 2px;
}

.sg-message--selected {
    background: var(--outlook-blue-light);
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.2);
}

.sg-message__checkbox {
    margin-right: 4px;
    flex-shrink: 0;
    align-self: center;
}

/* Avatar circles hidden in message list (New Outlook style) */
.sg-message .sg-message__avatar,
.sg-message .sg-avatar,
.sg-thread__header .sg-avatar {
    display: none;
}

/* Keep avatars in reading pane / preview */
.outlook-preview .sg-message__avatar,
.outlook-preview__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neutral-80);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    align-self: center;
}

.sg-message__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sg-message__row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    line-height: 1.3;
}

.sg-message__sender {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.sg-message--unread .sg-message__sender {
    font-weight: 700;
}

.sg-message__date {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sg-message__subject {
    font-size: 12px;
    color: var(--outlook-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.3;
}

.sg-message--unread .sg-message__subject {
    color: var(--outlook-blue);
    font-weight: 500;
}

.sg-message__preview {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.sg-message__attachment {
    font-size: 14px !important;
    color: var(--text-tertiary);
}

.sg-message__flags {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    margin-left: var(--spacing-sm);
}

.sg-message__flag {
    font-size: 16px;
    color: var(--text-tertiary);
}

.sg-message__flag--attachment {
    color: var(--text-secondary);
}

.sg-message__flag--flagged {
    color: var(--error);
}

/* ====== Star / Flag Icon ====== */
.sg-message__star {
    margin-right: 2px;
    color: transparent;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.15s ease;
    font-variation-settings: 'FILL' 0, 'wght' 250, 'GRAD' 0, 'opsz' 20;
}

.sg-message:hover .sg-message__star {
    color: rgba(255, 255, 255, 0.2);
}

.sg-message:hover .sg-message__star:hover {
    color: var(--warning);
}

.sg-message__star--active {
    color: var(--warning) !important;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ====== Avatar System (Gravatar → Favicon → Initials) ====== */
.sg-avatar {
    position: relative;
    border-radius: 50%;
    background: var(--avatar-bg, var(--neutral-60));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    user-select: none;
}

.sg-avatar--small {
    width: 32px;
    height: 32px;
    font-size: 12px;
    margin-right: var(--spacing-sm);
}

.sg-avatar--medium {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.sg-avatar--large {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.sg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sg-avatar--loaded img {
    opacity: 1;
}

.sg-avatar img.sg-avatar__favicon {
    width: 60%;
    height: 60%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
}

.sg-avatar--loaded img.sg-avatar__favicon {
    opacity: 1;
}

.sg-avatar__initials {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.sg-avatar--loaded .sg-avatar__initials {
    opacity: 0;
}

/* ====== Message List Hover Actions ====== */
.sg-message__hover-actions {
    display: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 3px;
    z-index: 2;
}

.sg-message:hover .sg-message__hover-actions {
    display: flex;
}

.sg-message__hover-actions .md-icon {
    font-size: 18px;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sg-message__hover-actions .md-icon:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Thread / Conversation View */
.sg-thread {
    border-bottom: 1px solid var(--border-subtle);
}

.sg-thread__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    gap: var(--spacing-sm);
}

.sg-thread__header:hover {
    background: var(--surface-hover);
}

.sg-thread__count {
    background: var(--neutral-90);
    color: var(--text-secondary);
    font-size: var(--font-size-caption);
    padding: 2px 6px;
    border-radius: var(--radius-round);
    font-weight: 500;
}

.sg-thread__messages {
    border-left: 2px solid var(--border-color);
    margin-left: var(--spacing-xl);
}

/* Sidebar Compatibility */
.sg-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    min-height: 32px;
}

.sg-sidebar__title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sg-sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: 2px 6px;
}

.sg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

/* Checkbox Compatibility */
.md-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.md-checkbox__input {
    display: none;
}

.md-checkbox__box {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    transition: all 0.1s ease;
    position: relative;
}

.md-checkbox__input:checked + .md-checkbox__box {
    background: var(--outlook-blue);
    border-color: var(--outlook-blue);
}

.md-checkbox__input:checked + .md-checkbox__box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Button Compatibility */
.md-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.md-icon-button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.md-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-1);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    color: var(--text-primary);
}

.md-button:hover {
    background: var(--surface-hover);
}

.md-button--filled {
    background: var(--outlook-blue);
    color: white;
}

.md-button--filled:hover {
    background: var(--outlook-blue-hover);
}

.md-button--outlined {
    border: 1px solid var(--border-color);
}

.md-button--outlined:hover {
    background: var(--surface-hover);
}

/* Avatar Compatibility */
.md-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    background: var(--outlook-blue);
    color: white;
    background-size: cover;
    background-position: center;
}

.md-avatar--small {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-body-2);
}

/* Preview Compatibility */
.sg-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.sg-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-preview__empty {
    text-align: center;
    color: var(--text-tertiary);
}

.sg-preview__empty-icon {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.3;
}

.sg-preview__empty-text {
    font-size: var(--font-size-subtitle);
}

.sg-preview__header {
    padding: 12px 20px;
    border-bottom: none;
    flex-shrink: 0;
}

.sg-preview__subject {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.sg-preview__meta {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.sg-preview__sender-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

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

.sg-preview__sender-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xxs);
}

.sg-preview__sender-email {
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.sg-preview__recipients {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
}

.sg-preview__date {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sg-preview__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sg-preview__toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sg-preview__content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

.sg-preview__body {
    font-size: var(--font-size-body-1);
    line-height: 1.6;
    color: var(--text-primary);
}

.sg-preview__body img {
    max-width: 100%;
    height: auto;
}

.sg-preview__attachments {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
}

.sg-preview__attachments-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-body-2);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.sg-preview__attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.sg-attachment {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-2);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sg-attachment:hover {
    border-color: var(--outlook-blue);
    background: var(--surface-hover);
}

/* Compose Compatibility */
.sg-compose {
    position: fixed;
    bottom: 0;
    right: var(--spacing-xl);
    width: var(--compose-width);
    max-width: calc(100vw - 100px);
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-28);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    max-height: 80vh;
}

.sg-compose--active {
    transform: translateY(0);
}

.sg-compose--minimized {
    transform: translateY(calc(100% - 48px));
}

.sg-compose--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: translateY(0);
}

.sg-compose__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--outlook-blue);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.sg-compose--fullscreen .sg-compose__header {
    border-radius: 0;
}

.sg-compose__title {
    font-size: var(--font-size-body-1);
    font-weight: 500;
    flex: 1;
}

.sg-compose__header-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.sg-compose__fields {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sg-compose__field {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.sg-compose__field:last-child {
    margin-bottom: 0;
}

.sg-compose__field-label {
    width: 60px;
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sg-compose__field-input {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    background: transparent;
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    outline: none;
}

.sg-compose__field-input::placeholder {
    color: var(--text-tertiary);
}

.sg-compose__editor {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sg-compose__editor-content {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    font-size: var(--font-size-body-1);
    line-height: 1.6;
    color: var(--text-primary);
    outline: none;
}

.sg-compose__attachments {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.sg-compose__toolbar {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.sg-compose__toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 var(--spacing-sm);
}

.sg-compose__send-btn {
    margin-left: auto;
}

/* Snackbar/Toast Compatibility */
.md-snackbar {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--neutral-20);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-16);
    z-index: 3000;
    opacity: 0;
    transition: var(--transition-normal);
}

.md-snackbar--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Menu Compatibility */
.md-menu {
    position: absolute;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-16);
    padding: var(--spacing-xs) 0;
    z-index: 1001;
    display: none;
}

.md-menu:not(.hidden) {
    display: block;
}

.md-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.md-menu-item:hover {
    background: var(--surface-hover);
}

.md-menu-item--danger {
    color: var(--error);
}

.md-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-xs) 0;
}

/* Modal Compatibility */
.sg-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.sg-modal:not(.hidden) {
    display: flex;
}

.sg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.sg-modal__content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-28);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sg-modal__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.sg-modal__title {
    font-size: var(--font-size-subtitle);
    font-weight: 600;
    flex: 1;
}

.sg-modal__body {
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.sg-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

/* View Tabs Compatibility */
.sg-view-tabs {
    display: flex;
    gap: var(--spacing-xs);
}

.sg-view-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-2);
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: var(--transition-fast);
}

.sg-view-tab:hover {
    background: var(--surface-hover);
}

.sg-view-tab--active {
    background: var(--surface-selected);
    color: var(--outlook-blue);
}

/* List Compatibility */
.sg-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-list__header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.sg-list__content {
    flex: 1;
    overflow-y: auto;
}

.sg-list__count {
    font-size: var(--font-size-body-2);
    color: var(--text-tertiary);
}

.sg-list__spacer {
    flex: 1;
}

.sg-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-tertiary);
}

/* Bulk Actions */
.sg-bulk-count {
    font-weight: 500;
}

/* Dropdown Compatibility */
.sg-dropdown {
    position: relative;
}

.sg-dropdown__menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-16);
    padding: var(--spacing-xs) 0;
    z-index: 1001;
    display: none;
}

.sg-dropdown__menu:not(.hidden) {
    display: block;
}

.sg-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.sg-dropdown__item:hover {
    background: var(--surface-hover);
}

.sg-dropdown__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-xs) 0;
}

/* Input Compatibility */
.md-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body-1);
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition-fast);
}

.md-input:focus {
    outline: none;
    border-color: var(--outlook-blue);
}

.md-input--small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-body-2);
}

.md-label {
    display: block;
    font-size: var(--font-size-body-2);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

/* Calendar/Contacts Sections */
#calendar-section,
#contacts-section {
    padding: var(--spacing-sm);
}

/* Progress Circular */
.md-progress-circular {
    width: 32px;
    height: 32px;
    animation: spin 1.4s linear infinite;
}

.md-progress-circular__circle {
    stroke: var(--outlook-blue);
    stroke-linecap: round;
    animation: progress-circular-dash 1.4s ease-in-out infinite;
}

@keyframes progress-circular-dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

/* ============================================
   Search Results - Outlook 2025 Style
   ============================================ */

/* Search Indicator Banner */
.sg-search-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.08) 0%, rgba(0, 120, 212, 0.04) 100%);
    border-bottom: 1px solid rgba(0, 120, 212, 0.2);
    padding: 12px 16px;
    min-height: 48px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sg-search-indicator.hidden {
    display: none;
}

.sg-search-indicator__content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.sg-search-indicator__content > .md-icon,
.sg-search-indicator__content > .material-icons {
    font-size: 20px;
    color: var(--outlook-blue);
}

.sg-search-indicator__content strong {
    color: var(--outlook-blue);
    font-weight: 600;
}

.sg-search-indicator__clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(0, 120, 212, 0.3);
    border-radius: 6px;
    color: var(--outlook-blue);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}

.sg-search-indicator__clear:hover {
    background: rgba(0, 120, 212, 0.1);
    border-color: var(--outlook-blue);
}

.sg-search-indicator__clear .md-icon,
.sg-search-indicator__clear .material-icons {
    font-size: 16px;
}

/* Search Result Folder Badge */
.sg-message__folder-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    margin-right: 8px;
    transition: all 0.15s ease;
}

.sg-message__folder-badge--inbox {
    background: rgba(96, 125, 139, 0.15);
    color: #455A64;
}

.sg-message__folder-badge--sent {
    background: rgba(33, 150, 243, 0.15);
    color: #1565C0;
}

.sg-message__folder-badge--drafts {
    background: rgba(255, 152, 0, 0.15);
    color: #E65100;
}

.sg-message__folder-badge--spam {
    background: rgba(244, 67, 54, 0.15);
    color: #C62828;
}

.sg-message__folder-badge--trash {
    background: rgba(158, 158, 158, 0.15);
    color: #616161;
}

.sg-message__folder-badge--custom {
    background: rgba(103, 58, 183, 0.15);
    color: #4527A0;
}

.sg-message__folder-badge .md-icon,
.sg-message__folder-badge .material-icons {
    font-size: 12px;
}

/* Search highlighting in message list */
.sg-message--search-match .sg-message__subject mark,
.sg-message--search-match .sg-message__preview mark,
.sg-message--search-match .sg-message__sender mark {
    background: rgba(255, 235, 59, 0.5);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* Enhanced Search Input */
.outlook-header__search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.outlook-header__search-input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 40px;
    background: var(--surface-tertiary);
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.outlook-header__search-input:focus {
    outline: none;
    border-color: var(--outlook-blue);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.outlook-header__search-input::placeholder {
    color: var(--text-tertiary);
}

.outlook-header__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 20px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.outlook-header__search-input:focus + .outlook-header__search-icon,
.outlook-header__search:focus-within .outlook-header__search-icon {
    color: var(--outlook-blue);
}

/* Search Clear Button */
.outlook-header__search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-header__search-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

/* When search input is focused (white background), use dark colors for clear button */
.outlook-header__search-input:focus ~ .outlook-header__search-clear {
    color: var(--text-tertiary);
}

.outlook-header__search-input:focus ~ .outlook-header__search-clear:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.outlook-header__search-input:not(:placeholder-shown) ~ .outlook-header__search-clear {
    display: flex;
}

/* Search Options Dropdown */
.outlook-search-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-16);
    padding: 8px;
    z-index: 1002;
    display: none;
    animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.outlook-search-options.active {
    display: block;
}

.outlook-search-options__section {
    margin-bottom: 8px;
}

.outlook-search-options__section:last-child {
    margin-bottom: 0;
}

.outlook-search-options__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
}

.outlook-search-options__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.outlook-search-options__item:hover {
    background: var(--surface-hover);
}

.outlook-search-options__item .material-icons {
    font-size: 18px;
    color: var(--text-secondary);
}

.outlook-search-options__item--active {
    background: rgba(0, 120, 212, 0.08);
    color: var(--outlook-blue);
}

.outlook-search-options__item--active .material-icons {
    color: var(--outlook-blue);
}

/* Search Scope Toggle */
.outlook-search-scope {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    margin-top: 4px;
}

.outlook-search-scope__checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.outlook-search-scope__checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--outlook-blue);
}

/* Material Icons Compatibility */
.md-icon {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* MD Button Compatibility */
.md-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.md-button--text {
    background: transparent;
    color: var(--outlook-blue);
    padding: 6px 12px;
}

.md-button--text:hover {
    background: rgba(0, 120, 212, 0.08);
}

/* ============================================
   Toolbar Button Disabled States
   ============================================ */
.outlook-action-btn:disabled,
.outlook-action-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.outlook-action-btn:disabled:hover,
.outlook-action-btn[disabled]:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
}

/* ============================================
   Contacts List (sg-contacts__* classes)
   Used by JavaScript renderContactList()
   ============================================ */
.sg-contacts__group {
    margin-bottom: var(--spacing-sm);
}

.sg-contacts__group-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.sg-contacts__contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}

.sg-contacts__contact:hover {
    background: rgba(0, 120, 212, 0.06);
}

.sg-contacts__contact.active {
    background: rgba(0, 120, 212, 0.1);
    border-left: 3px solid var(--outlook-blue);
    padding-left: 13px;
}

.sg-contacts__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--outlook-blue) 0%, #005a9e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.2);
    transition: all 0.2s ease;
}

.sg-contacts__contact:hover .sg-contacts__avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.sg-contacts__info {
    flex: 1;
    min-width: 0;
}

.sg-contacts__name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.sg-contacts__email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Addressbook Selection */
.sg-contacts__ab-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.sg-contacts__ab-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.sg-contacts__ab-item.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--outlook-blue);
    font-weight: 500;
}

.sg-contacts__ab-item .md-icon {
    font-size: 20px;
}

/* Contacts Placeholder */
.sg-contacts__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
}

.sg-contacts__placeholder .md-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* ============================================
   Contact Detail Panel (sg-contact-detail__* classes)
   Used by JavaScript showContactDetailPanel()
   ============================================ */
.sg-contact-detail {
    padding: var(--spacing-xl);
    height: 100%;
    overflow-y: auto;
}

.sg-contact-detail__header {
    text-align: center;
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-xl);
}

.sg-contact-detail__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--outlook-blue) 0%, #005a9e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 28px;
    margin: 0 auto var(--spacing-md);
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.3);
}

.sg-contact-detail__header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs);
}

.sg-contact-detail__header p {
    margin: 0;
}

.sg-contact-detail__actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.sg-contact-detail__section {
    margin-bottom: var(--spacing-xl);
}

.sg-contact-detail__section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.sg-contact-detail__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.sg-contact-detail__item:hover {
    background: var(--surface-hover);
    text-decoration: none;
}

.sg-contact-detail__item .md-icon {
    color: var(--outlook-blue);
    font-size: 20px;
}

.sg-contact-detail__type {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: auto;
    background: var(--surface-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.sg-contact-detail__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-tertiary);
}

.sg-contact-detail__placeholder .md-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* ============================================
   Settings View (sg-settings__* classes)
   Used by JavaScript renderSettings()
   ============================================ */
.sg-settings {
    display: flex;
    height: 100%;
    background: var(--surface);
}

.sg-settings__sidebar {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
    padding: var(--spacing-md);
    overflow-y: auto;
}

.sg-settings__nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.sg-settings__nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s ease;
}

.sg-settings__nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.sg-settings__nav-item.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--outlook-blue);
    font-weight: 500;
}

.sg-settings__nav-item .md-icon {
    font-size: 20px;
}

.sg-settings__nav-item--admin {
    color: var(--error);
}

.sg-settings__nav-item--admin:hover {
    background: rgba(209, 52, 56, 0.1);
}

.sg-settings__nav-item--admin.active {
    background: rgba(209, 52, 56, 0.15);
    color: var(--error);
}

.sg-settings__nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-sm) 0;
}

.sg-settings__main {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

.sg-settings__section {
    max-width: 700px;
}

.sg-settings__section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.sg-settings__group {
    margin-bottom: var(--spacing-xl);
}

.sg-settings__group h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sg-settings__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    cursor: default;
}

.sg-settings__option > span:first-child {
    font-size: 14px;
    color: var(--text-primary);
}

.sg-settings__option .md-select,
.sg-settings__option select {
    min-width: 180px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
}

.sg-settings__option input[type="text"],
.sg-settings__option input[type="email"],
.sg-settings__option input[type="number"] {
    min-width: 200px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
}

.sg-settings__option input:focus,
.sg-settings__option select:focus {
    outline: none;
    border-color: var(--outlook-blue);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.sg-settings__toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sg-settings__toggle input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: var(--neutral-60);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sg-settings__toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.sg-settings__toggle input[type="checkbox"]:checked {
    background: var(--outlook-blue);
}

.sg-settings__toggle input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* Settings Cards */
.sg-settings__card {
    background: var(--surface-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.sg-settings__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

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

.sg-settings__card-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* Settings List Items */
.sg-settings__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sg-settings__list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.sg-settings__list-item:hover {
    border-color: var(--border-color);
}

.sg-settings__list-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 120, 212, 0.1);
    border-radius: var(--radius-md);
    color: var(--outlook-blue);
}

.sg-settings__list-item-content {
    flex: 1;
    min-width: 0;
}

.sg-settings__list-item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sg-settings__list-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.sg-settings__list-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* Settings Buttons */
.sg-settings__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sg-settings__btn--primary {
    background: var(--outlook-blue);
    color: white;
}

.sg-settings__btn--primary:hover {
    background: var(--outlook-blue-hover);
}

.sg-settings__btn--secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.sg-settings__btn--secondary:hover {
    background: var(--surface-hover);
}

.sg-settings__btn--danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.sg-settings__btn--danger:hover {
    background: rgba(209, 52, 56, 0.1);
}

.sg-settings__btn--icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

/* Settings Empty State */
.sg-settings__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl);
    text-align: center;
    color: var(--text-tertiary);
}

.sg-settings__empty .md-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* Settings Loading */
.sg-settings__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl);
    gap: var(--spacing-sm);
    color: var(--text-secondary);
}

/* QR Code Display */
.sg-settings__qrcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl);
    background: white;
    border-radius: var(--radius-lg);
    margin: var(--spacing-md) 0;
}

.sg-settings__qrcode img {
    max-width: 200px;
    height: auto;
}

.sg-settings__qrcode-label {
    margin-top: var(--spacing-md);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Device List */
.sg-settings__device {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-sm);
}

.sg-settings__device-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.sg-settings__device-info {
    flex: 1;
}

.sg-settings__device-name {
    font-weight: 500;
    color: var(--text-primary);
}

.sg-settings__device-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.sg-settings__device-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.sg-settings__device-status--active {
    background: rgba(16, 124, 16, 0.1);
    color: var(--success);
}

.sg-settings__device-status--inactive {
    background: var(--surface-secondary);
    color: var(--text-tertiary);
}

/* Settings Responsive */
@media (max-width: 900px) {
    .sg-settings__sidebar {
        position: fixed;
        left: var(--rail-width);
        top: 0;
        bottom: 0;
        width: 240px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-16);
    }

    .sg-settings__sidebar--open {
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    .sg-settings__main {
        padding: var(--spacing-md);
    }

    .sg-settings__option {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .sg-settings__option .md-select,
    .sg-settings__option select,
    .sg-settings__option input {
        width: 100%;
    }
}

/* ============================================
   Mini Calendar (sg-mini-cal__* classes)
   Used by JavaScript renderMiniCalendar()
   ============================================ */
.sg-mini-cal__header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.sg-mini-cal__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.sg-mini-cal__weekdays span {
    padding: 4px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.sg-mini-cal__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 var(--spacing-xs);
}

.sg-mini-cal__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.sg-mini-cal__day:hover {
    background: var(--surface-hover);
}

.sg-mini-cal__day--empty {
    cursor: default;
}

.sg-mini-cal__day--empty:hover {
    background: transparent;
}

.sg-mini-cal__day--today {
    background: var(--outlook-blue);
    color: white;
    font-weight: 600;
}

.sg-mini-cal__day--today:hover {
    background: #005a9e;
}

.sg-mini-cal__day--selected:not(.sg-mini-cal__day--today) {
    background: rgba(0, 120, 212, 0.15);
    color: var(--outlook-blue);
    font-weight: 600;
}

/* ============================================
   Calendar List (sg-calendar__* classes)
   ============================================ */
.sg-calendar__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.sg-calendar__item:hover {
    background: var(--surface-hover);
}

.sg-calendar__item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--outlook-blue);
}

.sg-calendar__color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sg-calendar__name {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Loading States Enhancement
   ============================================ */
.outlook-loading,
.sg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    color: var(--text-tertiary);
}

.outlook-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--outlook-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hide loading when content is loaded */
.sg-folder-tree:not(:empty) > .sg-loading,
.sg-folder-tree:not(:empty) > .outlook-loading {
    display: none;
}

/* ====== Dialog / Modal ====== */
.sg-dialog {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
}

.sg-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.sg-dialog__content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-28);
    padding: 0;
    min-width: 300px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.sg-dialog__content h2 {
    margin: 0;
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-secondary);
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sg-dialog__content form,
.sg-dialog__content > :not(h2) {
    padding: 0 24px;
}

.sg-dialog__content form {
    padding-top: 20px;
    padding-bottom: 24px;
}

.sg-dialog__folders {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.sg-dialog__folder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.sg-dialog__folder:hover {
    background: var(--surface-hover);
}

.sg-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* Contact form styles for dialog */
.contact-field-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.contact-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface-secondary);
    border-radius: 8px;
}

.contact-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.contact-section-header .md-icon {
    color: var(--outlook-blue);
}

.contact-field-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.contact-field-row .md-input {
    flex: 1;
}

.contact-field-row select {
    width: 120px;
}

/* ============================================
   Scrollbar - New Outlook Thin Style
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Auto-hide scrollbar - only show on hover */
.outlook-folders__list,
.sg-sidebar__content,
.outlook-list__content,
.outlook-contacts__items {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ============================================
   Dark Mode Global Refinements - New Outlook 2025
   ============================================ */
[data-theme="dark"] .outlook-rail {
    background: #141414;
    border-right: none;
}

[data-theme="dark"] .outlook-header {
    background: #1f1f1f;
    border-bottom: 1px solid #2a2a2a;
}

[data-theme="dark"] .outlook-action-toolbar {
    background: #1f1f1f;
    border-bottom: 1px solid #2a2a2a;
}

[data-theme="dark"] .outlook-list__toolbar {
    background: #292929;
    border-bottom: 1px solid #2a2a2a;
}

[data-theme="dark"] .sg-message {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .sg-message--unread {
    background: rgba(255, 255, 255, 0.025);
}

[data-theme="dark"] .sg-message--active,
[data-theme="dark"] .sg-message.active {
    background: rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] .outlook-preview,
[data-theme="dark"] .sg-preview {
    background: #292929;
}

[data-theme="dark"] .outlook-folders,
[data-theme="dark"] .sg-sidebar {
    background: #1f1f1f;
    border-right: 1px solid #2a2a2a;
}

/* Reading pane empty state refinement */
[data-theme="dark"] .sg-preview__empty-icon,
[data-theme="dark"] .outlook-preview__empty-icon {
    opacity: 0.15;
}

/* Hover actions in dark */
[data-theme="dark"] .sg-message__hover-actions {
    background: #333333;
    border: 1px solid #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Menu/dropdown in dark */
[data-theme="dark"] .md-menu,
[data-theme="dark"] .outlook-menu {
    background: #2d2d2d;
    border-color: #404040;
}

/* Compose in dark */
[data-theme="dark"] .sg-compose,
[data-theme="dark"] .outlook-compose {
    background: #2d2d2d;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

/* Modal/Dialog in dark */
[data-theme="dark"] .sg-modal__content,
[data-theme="dark"] .outlook-modal__content,
[data-theme="dark"] .sg-dialog__content {
    background: #2d2d2d;
    border: 1px solid #404040;
}

[data-theme="dark"] .sg-modal__backdrop,
[data-theme="dark"] .outlook-modal__backdrop {
    background: rgba(0, 0, 0, 0.6);
}

/* Calendar in dark */
[data-theme="dark"] .outlook-calendar-sidebar {
    background: #1f1f1f;
    border-right: 1px solid #2a2a2a;
}

[data-theme="dark"] .outlook-calendar__grid {
    border-color: #333333;
}

[data-theme="dark"] .outlook-calendar__day {
    border-right-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .outlook-calendar__week {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .outlook-calendar__day--other {
    background: #1f1f1f;
}

/* Selected folder in dark - subtle blue tint */
[data-theme="dark"] .sg-folder__item--active,
[data-theme="dark"] .sg-folder__item.active {
    background: rgba(0, 120, 212, 0.15);
}

/* Input fields in dark */
[data-theme="dark"] .outlook-input,
[data-theme="dark"] .md-input,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="search"] {
    background: rgba(255, 255, 255, 0.06);
    border-color: #404040;
}

[data-theme="dark"] .outlook-input:focus,
[data-theme="dark"] .md-input:focus {
    border-color: var(--outlook-blue);
    box-shadow: 0 0 0 1px var(--outlook-blue);
}

/* ============================================
   Dark Mode - Reading Pane Refinements (New Outlook 2025)
   ============================================ */

/* Ghost-style action buttons in reading pane */
[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 400;
    padding: 5px 14px;
    border-radius: var(--radius-md);
}

[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary:hover,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Material icons inside action buttons - muted by default */
[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary .material-icons,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary .material-icons,
[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary .md-icon,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary .md-icon {
    font-size: 16px;
    color: var(--text-tertiary);
}

[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary:hover .material-icons,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary:hover .material-icons,
[data-theme="dark"] .outlook-preview__actions .outlook-btn--secondary:hover .md-icon,
[data-theme="dark"] .sg-preview__actions .outlook-btn--secondary:hover .md-icon {
    color: var(--text-primary);
}

/* Reading pane header - no separator line */
[data-theme="dark"] .outlook-preview__header,
[data-theme="dark"] .sg-preview__header {
    border-bottom: none;
}

/* Reading pane actions bar - subtle separator */
[data-theme="dark"] .outlook-preview__actions,
[data-theme="dark"] .sg-preview__actions {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sender info refinement */
[data-theme="dark"] .outlook-preview__sender-email,
[data-theme="dark"] .sg-preview__sender-email {
    color: var(--text-tertiary);
}

[data-theme="dark"] .outlook-preview__recipients,
[data-theme="dark"] .sg-preview__recipients {
    color: var(--text-tertiary);
    font-size: 12px;
}

[data-theme="dark"] .outlook-preview__date,
[data-theme="dark"] .sg-preview__date {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Reading pane body */
[data-theme="dark"] .outlook-preview__body,
[data-theme="dark"] .sg-preview__body {
    color: var(--text-secondary);
}

/* Reading pane content area padding */
[data-theme="dark"] .outlook-preview__content,
[data-theme="dark"] .sg-preview__content {
    padding: 16px 20px;
}

/* Attachment area dark mode */
[data-theme="dark"] .outlook-preview__attachments,
[data-theme="dark"] .sg-preview__attachments {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Icon buttons in reading pane toolbar */
[data-theme="dark"] .outlook-preview__actions .outlook-btn--icon,
[data-theme="dark"] .sg-preview__actions .outlook-btn--icon,
[data-theme="dark"] .outlook-preview__toolbar .outlook-btn--icon,
[data-theme="dark"] .sg-preview__toolbar .outlook-btn--icon {
    color: var(--text-tertiary);
    border: none;
}

[data-theme="dark"] .outlook-preview__actions .outlook-btn--icon:hover,
[data-theme="dark"] .sg-preview__actions .outlook-btn--icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
