/**
 * CloudX Webmail - Unique CloudX Design
 * A distinctive, modern email client design
 * CloudX Brand Identity
 */

/* ========================================
   CSS Variables - CloudX Brand Palette
   ======================================== */

:root {
    /* CloudX Primary Brand Colors - Zimbra Standard */
    --cx-primary: #007CC3;           /* Zimbra Blue - Official Brand Color */
    --cx-primary-dark: #005A95;      /* Zimbra Link Blue */
    --cx-primary-light: #C7E6F6;     /* Zimbra Selection/Alt Color */
    --cx-secondary: #0087C3;         /* Zimbra App Row Color */
    --cx-secondary-dark: #006699;
    --cx-accent: #F15922;            /* Zimbra Orange - Primary Branding */
    --cx-accent-light: #FF8A65;

    /* CloudX Gradient - Zimbra Blue Based */
    --cx-gradient: linear-gradient(135deg, #007CC3 0%, #0087C3 50%, #00A0D1 100%);
    --cx-gradient-subtle: linear-gradient(135deg, rgba(0,124,195,0.1) 0%, rgba(0,135,195,0.05) 100%);

    /* Application Colors */
    --cx-app-bg: #FAFBFF;
    --cx-chrome-bg: #F1F5F9;
    --cx-panel-bg: #FFFFFF;
    --cx-sidebar-bg: linear-gradient(180deg, #1E1B4B 0%, #312E81 100%);
    --cx-sidebar-bg-light: #F8FAFC;

    /* Text Colors - Zimbra Standard */
    --cx-text-primary: #333333;      /* Zimbra TxtC */
    --cx-text-secondary: #475569;
    --cx-text-muted: #94A3B8;
    --cx-text-link: #005A95;         /* Zimbra Link Color */
    --cx-text-light: #FFFFFF;

    /* Border Colors */
    --cx-border-light: #E2E8F0;
    --cx-border-medium: #CBD5E1;
    --cx-border-dark: #94A3B8;

    /* Selection & Highlight - Zimbra Standard */
    --cx-selection-bg: #C7E6F6;      /* Zimbra SelC/AltC */
    --cx-selection-border: #007CC3;   /* Zimbra Blue */
    --cx-hover-bg: #F0F7FC;           /* Light blue hover */
    --cx-unread-bg: #E3F2FD;          /* Light blue unread */

    /* Status Colors */
    --cx-success: #10B981;
    --cx-warning: #F59E0B;
    --cx-danger: #EF4444;
    --cx-info: #0EA5E9;

    /* Shadows */
    --cx-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --cx-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --cx-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --cx-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --cx-shadow-glow: 0 0 20px rgba(0,124,195,0.3);  /* Zimbra Blue glow */

    /* Spacing */
    --cx-spacing-xs: 4px;
    --cx-spacing-sm: 8px;
    --cx-spacing-md: 16px;
    --cx-spacing-lg: 24px;
    --cx-spacing-xl: 32px;

    /* Border Radius */
    --cx-radius-sm: 6px;
    --cx-radius-md: 8px;
    --cx-radius-lg: 12px;
    --cx-radius-xl: 16px;
    --cx-radius-full: 9999px;

    /* Typography */
    --cx-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --cx-font-size-xs: 11px;
    --cx-font-size-sm: 12px;
    --cx-font-size-md: 13px;
    --cx-font-size-lg: 14px;
    --cx-font-size-xl: 16px;
    --cx-font-size-xxl: 20px;
    --cx-font-size-3xl: 24px;

    /* Legacy Zimbra variables (for backwards compatibility) */
    --zm-primary: var(--cx-primary);
    --zm-primary-dark: var(--cx-primary-dark);
    --zm-secondary: var(--cx-secondary);
    --zm-secondary-dark: var(--cx-secondary-dark);
    --zm-secondary-light: var(--cx-selection-bg);
    --zm-app-bg: var(--cx-panel-bg);
    --zm-chrome-bg: var(--cx-chrome-bg);
    --zm-panel-bg: var(--cx-panel-bg);
    --zm-sidebar-bg: var(--cx-sidebar-bg-light);
    --zm-text-primary: var(--cx-text-primary);
    --zm-text-secondary: var(--cx-text-secondary);
    --zm-text-muted: var(--cx-text-muted);
    --zm-text-link: var(--cx-text-link);
    --zm-border-light: var(--cx-border-light);
    --zm-border-medium: var(--cx-border-medium);
    --zm-border-dark: var(--cx-border-dark);
    --zm-selection-bg: var(--cx-selection-bg);
    --zm-selection-border: var(--cx-selection-border);
    --zm-hover-bg: var(--cx-hover-bg);
    --zm-unread-bg: var(--cx-unread-bg);
    --zm-success: var(--cx-success);
    --zm-warning: var(--cx-warning);
    --zm-danger: var(--cx-danger);
    --zm-info: var(--cx-info);
    --zm-shadow-sm: var(--cx-shadow-sm);
    --zm-shadow-md: var(--cx-shadow-md);
    --zm-shadow-lg: var(--cx-shadow-lg);
    --zm-spacing-xs: var(--cx-spacing-xs);
    --zm-spacing-sm: var(--cx-spacing-sm);
    --zm-spacing-md: var(--cx-spacing-md);
    --zm-spacing-lg: var(--cx-spacing-lg);
    --zm-spacing-xl: var(--cx-spacing-xl);
    --zm-radius-sm: var(--cx-radius-sm);
    --zm-radius-md: var(--cx-radius-md);
    --zm-radius-lg: var(--cx-radius-lg);
    --zm-font-family: var(--cx-font-family);
    --zm-font-size-xs: var(--cx-font-size-xs);
    --zm-font-size-sm: var(--cx-font-size-sm);
    --zm-font-size-md: var(--cx-font-size-md);
    --zm-font-size-lg: var(--cx-font-size-lg);
    --zm-font-size-xl: var(--cx-font-size-xl);
    --zm-font-size-xxl: var(--cx-font-size-xxl);
}

/* ========================================
   Global Reset & Base Styles
   ======================================== */

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

html, body {
    height: 100%;
    font-family: var(--zm-font-family);
    font-size: var(--zm-font-size-md);
    color: var(--zm-text-primary);
    background-color: var(--zm-chrome-bg);
    line-height: 1.4;
}

/* ========================================
   Login Page - Zimbra Style
   ======================================== */

.zm-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--zm-spacing-lg);
}

.zm-login-container {
    width: 100%;
    max-width: 900px;
    background: var(--zm-app-bg);
    border-radius: var(--zm-radius-lg);
    box-shadow: var(--zm-shadow-lg);
    overflow: hidden;
    display: flex;
}

.zm-login-branding {
    flex: 1;
    background: linear-gradient(135deg, var(--zm-secondary) 0%, var(--zm-secondary-dark) 100%);
    padding: var(--zm-spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.zm-login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.zm-login-logo {
    position: relative;
    z-index: 1;
    text-align: center;
}

.zm-login-logo i {
    font-size: 64px;
    margin-bottom: var(--zm-spacing-md);
}

.zm-login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--zm-spacing-sm);
}

.zm-login-logo p {
    opacity: 0.8;
    font-size: var(--zm-font-size-lg);
}

.zm-login-features {
    position: relative;
    z-index: 1;
    margin-top: var(--zm-spacing-xl);
}

.zm-login-feature {
    display: flex;
    align-items: center;
    margin-bottom: var(--zm-spacing-md);
    font-size: var(--zm-font-size-lg);
}

.zm-login-feature i {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--zm-spacing-md);
    font-size: 16px;
}

.zm-login-form-container {
    flex: 1;
    padding: var(--zm-spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.zm-login-header {
    text-align: center;
    margin-bottom: var(--zm-spacing-lg);
}

.zm-login-header h2 {
    font-size: var(--zm-font-size-xxl);
    font-weight: 700;
    color: var(--zm-text-primary);
    margin-bottom: var(--zm-spacing-sm);
}

.zm-login-header p {
    color: var(--zm-text-secondary);
    font-size: var(--zm-font-size-lg);
}

/* Form Styles */
.zm-form-group {
    margin-bottom: var(--zm-spacing-md);
}

.zm-form-label {
    display: block;
    font-weight: 600;
    color: var(--zm-text-primary);
    margin-bottom: var(--zm-spacing-xs);
    font-size: var(--zm-font-size-md);
}

.zm-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--zm-border-medium);
    border-radius: var(--zm-radius-sm);
    font-size: var(--zm-font-size-lg);
    color: var(--zm-text-primary);
    background: var(--zm-app-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.zm-form-input:focus {
    outline: none;
    border-color: var(--zm-secondary);
    box-shadow: 0 0 0 3px rgba(0, 124, 195, 0.15);
}

.zm-form-input::placeholder {
    color: var(--zm-text-muted);
}

.zm-input-group {
    position: relative;
    display: flex;
}

.zm-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--zm-text-muted);
}

.zm-input-group .zm-form-input {
    padding-left: 40px;
}

.zm-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--zm-text-muted);
    cursor: pointer;
    padding: 4px;
}

.zm-toggle-password:hover {
    color: var(--zm-text-secondary);
}

/* Button Styles */
.zm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: var(--zm-font-size-md);
    font-weight: 600;
    border-radius: var(--zm-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.zm-btn i {
    margin-right: var(--zm-spacing-sm);
}

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

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

.zm-btn-secondary {
    background: var(--zm-chrome-bg);
    color: var(--zm-text-primary);
    border: 1px solid var(--zm-border-medium);
}

.zm-btn-secondary:hover {
    background: var(--zm-border-light);
}

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

.zm-btn-danger:hover {
    background: #c82333;
}

.zm-btn-block {
    width: 100%;
}

.zm-btn-lg {
    padding: 12px 24px;
    font-size: var(--zm-font-size-lg);
}

.zm-btn-sm {
    padding: 6px 12px;
    font-size: var(--zm-font-size-sm);
}

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

.zm-checkbox input {
    width: 16px;
    height: 16px;
    margin-right: var(--zm-spacing-sm);
    accent-color: var(--zm-secondary);
}

.zm-checkbox span {
    color: var(--zm-text-secondary);
    font-size: var(--zm-font-size-md);
}

/* Links */
.zm-link {
    color: var(--zm-text-link);
    text-decoration: none;
    font-size: var(--zm-font-size-md);
}

.zm-link:hover {
    text-decoration: underline;
}

/* Alerts */
.zm-alert {
    padding: var(--zm-spacing-md);
    border-radius: var(--zm-radius-sm);
    margin-bottom: var(--zm-spacing-md);
    display: flex;
    align-items: flex-start;
}

.zm-alert i {
    margin-right: var(--zm-spacing-sm);
    margin-top: 2px;
}

.zm-alert-danger {
    background: #FEEEEE;
    color: var(--zm-danger);
    border-left: 4px solid var(--zm-danger);
}

.zm-alert-success {
    background: #E8F5E9;
    color: var(--zm-success);
    border-left: 4px solid var(--zm-success);
}

.zm-alert-warning {
    background: #FFF8E1;
    color: #856404;
    border-left: 4px solid var(--zm-warning);
}

.zm-alert-info {
    background: var(--zm-secondary-light);
    color: var(--zm-secondary-dark);
    border-left: 4px solid var(--zm-secondary);
}

/* Login Footer */
.zm-login-footer {
    margin-top: var(--zm-spacing-lg);
    text-align: center;
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-muted);
}

.zm-login-footer a {
    color: var(--zm-text-link);
    text-decoration: none;
    margin: 0 var(--zm-spacing-sm);
}

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

/* ========================================
   Main Application Shell
   ======================================== */

.zm-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f6f8fc;
}

/* ========================================
   CloudX Header - Zimbra Blue Header
   ======================================== */

.gm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: linear-gradient(135deg, #007CC3 0%, #005A95 100%);
    border-bottom: none;
    height: 64px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,92,149,0.3);
}

/* Remove gradient line - header is now colored */
.gm-header::before {
    display: none;
}

.gm-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}

.gm-hamburger {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: all 0.2s ease;
}

.gm-hamburger:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.gm-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--cx-radius-md);
    transition: background 0.2s ease;
}

.gm-logo:hover {
    background: rgba(255,255,255,0.1);
}

.gm-logo-img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    object-fit: contain;
}

.gm-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #fff;
    letter-spacing: -0.5px;
}

/* CloudX Search Bar - White on Blue Header */
.gm-header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 24px;
}

.gm-search-form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: var(--cx-radius-full);
    padding: 0 6px;
    height: 42px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.gm-search-form::before {
    display: none;
}

.gm-search-form:focus-within {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gm-search-form:focus-within::before {
    display: none;
}

.gm-search-icon,
.gm-search-options {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 15px;
    transition: all 0.2s ease;
}

.gm-search-icon:hover,
.gm-search-options:hover {
    background: var(--cx-selection-bg);
    color: var(--cx-primary);
}

.gm-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    padding: 0 12px;
    outline: none;
    color: var(--cx-text-primary);
    font-family: var(--cx-font-family);
}

.gm-search-input::placeholder {
    color: #888;
}

/* Header Right Actions */
.gm-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gm-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(16,185,129,0.05) 100%);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--cx-radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--cx-success);
    margin-right: 8px;
}

.gm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cx-success);
    box-shadow: 0 0 8px rgba(16,185,129,0.5);
}

.gm-status-dot.active {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(16,185,129,0.5);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 16px rgba(16,185,129,0.8);
    }
}

.gm-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gm-icon-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.gm-app-grid-icon {
    width: 22px;
    height: 22px;
}

/* App Grid Dropdown - CloudX Style */
.gm-app-grid-wrapper {
    position: relative;
}

.gm-app-grid-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--cx-panel-bg);
    border-radius: var(--cx-radius-xl);
    box-shadow: var(--cx-shadow-xl);
    border: 1px solid var(--cx-border-light);
    padding: 16px;
    display: none;
    z-index: 1000;
    min-width: 300px;
}

.gm-app-grid-dropdown.open {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.gm-app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gm-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    text-decoration: none;
    border-radius: var(--cx-radius-lg);
    transition: all 0.2s ease;
}

.gm-app-item:hover {
    background: var(--cx-selection-bg);
    transform: translateY(-2px);
}

.gm-app-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--cx-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
    box-shadow: var(--cx-shadow-md);
    transition: transform 0.2s ease;
}

.gm-app-item:hover .gm-app-icon {
    transform: scale(1.05);
}

.gm-app-icon.mail { background: var(--cx-gradient); }
.gm-app-icon.calendar { background: linear-gradient(135deg, #0EA5E9, #0284C7); }
.gm-app-icon.contacts { background: linear-gradient(135deg, #10B981, #059669); }
.gm-app-icon.settings { background: linear-gradient(135deg, #64748B, #475569); }
.gm-app-icon.admin { background: linear-gradient(135deg, #F59E0B, #D97706); }

.gm-app-item span {
    font-size: 12px;
    font-weight: 500;
    color: var(--cx-text-primary);
}

/* Avatar Menu - CloudX Style */
.gm-avatar-wrapper {
    position: relative;
    margin-left: 8px;
}

.gm-avatar-btn {
    border: none;
    background: none;
    padding: 2px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.gm-avatar-btn:hover {
    background: rgba(255,255,255,0.1);
}

.gm-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gm-avatar-btn:hover .gm-avatar {
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gm-avatar-letter {
    color: var(--cx-primary);
    font-size: 14px;
    font-weight: 600;
}

.gm-avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--cx-panel-bg);
    border-radius: var(--cx-radius-xl);
    box-shadow: var(--cx-shadow-xl);
    border: 1px solid var(--cx-border-light);
    display: none;
    z-index: 1000;
    min-width: 340px;
    overflow: hidden;
}

.gm-avatar-dropdown.open {
    display: block;
    animation: slideDown 0.2s ease;
}

.gm-avatar-header {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--cx-gradient-subtle);
    border-bottom: 1px solid var(--cx-border-light);
}

.gm-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--cx-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    box-shadow: var(--cx-shadow-lg);
}

.gm-avatar-large .gm-avatar-letter {
    font-size: 28px;
}

.gm-avatar-info {
    flex: 1;
}

.gm-avatar-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--cx-text-primary);
    margin-bottom: 4px;
}

.gm-avatar-email {
    font-size: 14px;
    color: var(--cx-text-secondary);
}

/* Avatar Menu List */
.gm-avatar-menu {
    padding: 8px 0;
    max-height: 320px;
    overflow-y: auto;
}

.gm-avatar-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--cx-text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gm-avatar-menu-item:hover {
    background: var(--cx-hover-bg);
}

.gm-avatar-menu-item i {
    width: 20px;
    margin-right: 14px;
    color: var(--cx-text-muted);
    font-size: 16px;
    text-align: center;
}

.gm-avatar-menu-item:hover i {
    color: var(--cx-primary);
}

.gm-avatar-menu-item span {
    flex: 1;
}

.gm-avatar-menu-divider {
    height: 1px;
    background: var(--cx-border-light);
    margin: 8px 0;
}

/* Legacy - keep for backward compatibility */
.gm-avatar-actions {
    padding: 12px;
}

.gm-avatar-action {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--cx-text-primary);
    text-decoration: none;
    border-radius: var(--cx-radius-md);
    font-size: 14px;
    transition: all 0.2s ease;
}

.gm-avatar-action:hover {
    background: var(--cx-selection-bg);
    color: var(--cx-primary);
}

.gm-avatar-action i {
    margin-right: 12px;
    color: var(--cx-text-muted);
    width: 20px;
    transition: color 0.2s ease;
}

.gm-avatar-action:hover i {
    color: var(--cx-primary);
}

.gm-avatar-footer {
    padding: 12px;
    border-top: 1px solid var(--cx-border-light);
}

.gm-logout-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid var(--cx-border-medium);
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--cx-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gm-logout-btn:hover {
    background: var(--cx-danger);
    border-color: var(--cx-danger);
    color: #fff;
}

.gm-logout-btn i {
    margin-right: 8px;
}

/* ========================================
   CloudX Main Layout - Unique Design
   ======================================== */

.gm-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--cx-app-bg);
}

/* Left Rail - Light Style */
.gm-left-rail {
    width: 60px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
}

.gm-rail-item {
    width: 44px;
    height: 44px;
    border-radius: var(--cx-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 18px;
    transition: all 0.25s ease;
    position: relative;
}

.gm-rail-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--cx-primary);
    border-radius: 0 4px 4px 0;
    transition: height 0.25s ease;
}

.gm-rail-item:hover {
    color: var(--cx-primary);
    background: rgba(0,124,195,0.08);
}

.gm-rail-item.active {
    color: var(--cx-primary);
    background: rgba(0,124,195,0.12);
    box-shadow: none;
}

.gm-rail-item.active::before {
    height: 24px;
}

/* CloudX Sidebar - Light Design */
.gm-sidebar {
    width: 260px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border-right: 1px solid #e5e7eb;
    position: relative;
}

/* Remove decorative line */
.gm-sidebar::before {
    display: none;
}

.gm-sidebar.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.gm-compose-wrapper {
    padding: 20px 16px;
}

/* CloudX Compose Button - Zimbra Blue */
.gm-compose-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--cx-primary);
    border-radius: var(--cx-radius-full);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,124,195,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gm-compose-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.gm-compose-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,124,195,0.45);
}

.gm-compose-btn:hover::before {
    left: 100%;
}

.gm-compose-btn i {
    margin-right: 12px;
    font-size: 16px;
}

/* Folder Navigation - CloudX Style */
.gm-folder-nav {
    flex: 1;
    padding: 0 8px;
}

.gm-folder-item {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 40px;
    color: var(--cx-text-primary);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--cx-radius-lg);
    margin: 2px 0;
    transition: all 0.2s ease;
    position: relative;
}

.gm-folder-item:hover {
    background: rgba(0,124,195,0.08);
    color: var(--cx-primary);
}

/* CloudX Active Folder Item - Zimbra Blue */
.gm-folder-item.active {
    background: linear-gradient(90deg, rgba(0,124,195,0.15), rgba(0,135,195,0.1));
    color: var(--cx-primary);
    font-weight: 600;
    border-left: 3px solid var(--cx-primary);
}

.gm-folder-item.active i {
    color: var(--cx-primary);
}

.gm-folder-item i {
    width: 20px;
    margin-right: 14px;
    font-size: 15px;
    color: var(--cx-text-secondary);
    transition: color 0.2s ease;
}

.gm-folder-item:hover i {
    color: var(--cx-primary);
}

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

.gm-folder-count {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--cx-primary);
    padding: 2px 8px;
    border-radius: var(--cx-radius-full);
    min-width: 20px;
    text-align: center;
}

.gm-folder-count.draft {
    background: var(--cx-warning);
}

/* More/Expand Section - CloudX Style */
.gm-folder-expand {
    padding: 8px 0;
}

.gm-expand-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cx-text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    border-radius: var(--cx-radius-md);
    transition: all 0.2s ease;
}

.gm-expand-btn:hover {
    background: rgba(0,124,195,0.08);
    color: var(--cx-primary);
}

.gm-expand-btn i {
    width: 20px;
    margin-right: 14px;
    font-size: 11px;
    transition: transform 0.3s ease;
}

/* Labels Section - Zimbra Style */
.gm-labels-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,124,195,0.15);
}

.gm-labels-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 36px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cx-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gm-labels-add {
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(0,124,195,0.1);
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cx-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.gm-labels-add:hover {
    background: var(--cx-primary);
    color: #fff;
}

.gm-folder-item.manage-link {
    margin-top: 8px;
    color: var(--cx-text-secondary);
    font-size: 13px;
}

.gm-folder-item.manage-link:hover {
    color: var(--cx-primary);
}

/* Storage Quota - Zimbra Style */
.gm-storage {
    padding: 16px;
    background: rgba(0,124,195,0.05);
    border-top: 1px solid rgba(0,124,195,0.1);
    margin-top: auto;
    border-radius: 0 0 0 var(--cx-radius-lg);
}

.gm-storage-bar {
    height: 6px;
    background: rgba(0,124,195,0.15);
    border-radius: var(--cx-radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.gm-storage-used {
    height: 100%;
    background: var(--cx-gradient);
    border-radius: var(--cx-radius-full);
    transition: width 0.3s ease;
}

.gm-storage-text {
    font-size: 12px;
    color: var(--cx-text-secondary);
    font-weight: 500;
}

/* ========================================
   Legacy Zimbra Banner (keep for backwards compatibility)
   ======================================== */

/* Top Banner/Header */
.zm-banner {
    background: linear-gradient(to bottom, var(--zm-secondary), var(--zm-secondary-dark));
    color: white;
    padding: 0 var(--zm-spacing-md);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.zm-banner-logo {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: var(--zm-font-size-lg);
}

.zm-banner-logo i {
    margin-right: var(--zm-spacing-sm);
    font-size: 18px;
}

.zm-banner-nav {
    display: flex;
    align-items: center;
    gap: var(--zm-spacing-md);
}

.zm-banner-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: var(--zm-font-size-sm);
    padding: var(--zm-spacing-xs) var(--zm-spacing-sm);
    border-radius: var(--zm-radius-sm);
    transition: background 0.2s;
}

.zm-banner-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.zm-banner-nav a.active {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

/* Admin link styling - distinct from regular nav items */
.zm-banner-nav a.admin-link {
    color: #FFD700;  /* Gold color for admin */
    border: 1px solid rgba(255,215,0,0.3);
}

.zm-banner-nav a.admin-link:hover {
    background: rgba(255,215,0,0.15);
    border-color: rgba(255,215,0,0.5);
}

.zm-banner-nav a.admin-link.active {
    background: rgba(255,215,0,0.25);
}

.zm-banner-user {
    display: flex;
    align-items: center;
    gap: var(--zm-spacing-sm);
    font-size: var(--zm-font-size-sm);
}

.zm-banner-user .user-name {
    font-weight: 600;
}

/* Toolbar */
.zm-toolbar {
    background: var(--zm-app-bg);
    border-bottom: 1px solid var(--zm-border-light);
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--zm-spacing-sm);
    flex-shrink: 0;
}

.zm-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zm-toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--zm-border-light);
    margin: 0 var(--zm-spacing-sm);
}

.zm-toolbar-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--zm-chrome-bg);
    border: 1px solid var(--zm-border-medium);
    border-radius: var(--zm-radius-sm);
    color: var(--zm-text-primary);
    font-size: var(--zm-font-size-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.zm-toolbar-btn:hover {
    background: var(--zm-selection-bg);
    border-color: var(--zm-secondary);
}

.zm-toolbar-btn i {
    margin-right: 6px;
}

.zm-toolbar-btn.primary {
    background: var(--zm-secondary);
    border-color: var(--zm-secondary);
    color: white;
}

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

/* Search Box */
.zm-search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.zm-search-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border: 1px solid var(--zm-border-medium);
    border-radius: var(--zm-radius-md);
    font-size: var(--zm-font-size-sm);
    background: var(--zm-app-bg);
}

.zm-search-input:focus {
    outline: none;
    border-color: var(--zm-secondary);
}

.zm-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--zm-text-muted);
    font-size: 14px;
}

/* Main Content Area */
.zm-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar / Folder Tree */
.zm-sidebar {
    width: 220px;
    background: var(--zm-sidebar-bg);
    border-right: 1px solid var(--zm-border-light);
    overflow-y: auto;
    flex-shrink: 0;
}

.zm-sidebar-section {
    padding: var(--zm-spacing-sm) 0;
}

.zm-sidebar-header {
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    font-size: var(--zm-font-size-xs);
    font-weight: 600;
    color: var(--zm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.zm-folder-item {
    display: flex;
    align-items: center;
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    color: var(--zm-text-primary);
    text-decoration: none;
    font-size: var(--zm-font-size-md);
    cursor: pointer;
    transition: background 0.15s;
}

.zm-folder-item:hover {
    background: var(--zm-hover-bg);
}

.zm-folder-item.active {
    background: var(--zm-selection-bg);
    border-left: 3px solid var(--zm-secondary);
    padding-left: calc(var(--zm-spacing-md) - 3px);
}

.zm-folder-item i {
    width: 20px;
    margin-right: var(--zm-spacing-sm);
    color: var(--zm-text-secondary);
    font-size: 14px;
}

.zm-folder-item.active i {
    color: var(--zm-secondary);
}

.zm-folder-name {
    flex: 1;
}

.zm-folder-count {
    background: var(--zm-secondary);
    color: white;
    font-size: var(--zm-font-size-xs);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Content Area */
.zm-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--zm-app-bg);
}

/* Message List */
.zm-message-list {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid var(--zm-border-light);
}

.zm-message-list-header {
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    background: var(--zm-panel-bg);
    border-bottom: 1px solid var(--zm-border-light);
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.zm-message-item {
    display: flex;
    align-items: flex-start;
    padding: var(--zm-spacing-md);
    border-bottom: 1px solid var(--zm-border-light);
    cursor: pointer;
    transition: background 0.15s;
}

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

.zm-message-item.selected {
    background: var(--zm-selection-bg);
    border-left: 3px solid var(--zm-secondary);
    padding-left: calc(var(--zm-spacing-md) - 3px);
}

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

.zm-message-item.unread .zm-message-subject,
.zm-message-item.unread .zm-message-from {
    font-weight: 700;
}

.zm-message-checkbox {
    margin-right: var(--zm-spacing-md);
    margin-top: 4px;
}

.zm-message-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--zm-secondary);
}

.zm-message-star {
    margin-right: var(--zm-spacing-md);
    color: var(--zm-text-muted);
    cursor: pointer;
    font-size: 14px;
}

.zm-message-star.starred {
    color: #FFD700;
}

.zm-message-content {
    flex: 1;
    min-width: 0;
}

.zm-message-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 4px;
}

.zm-message-from {
    flex: 1;
    font-size: var(--zm-font-size-md);
    color: var(--zm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zm-message-date {
    font-size: var(--zm-font-size-xs);
    color: var(--zm-text-muted);
    margin-left: var(--zm-spacing-sm);
}

.zm-message-subject {
    font-size: var(--zm-font-size-md);
    color: var(--zm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.zm-message-preview {
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zm-message-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--zm-spacing-sm);
}

.zm-message-icons i {
    font-size: 12px;
    color: var(--zm-text-muted);
}

/* Reading Pane */
.zm-reading-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
}

.zm-reading-header {
    padding: var(--zm-spacing-md);
    border-bottom: 1px solid var(--zm-border-light);
    background: var(--zm-panel-bg);
}

.zm-reading-subject {
    font-size: var(--zm-font-size-xl);
    font-weight: 600;
    color: var(--zm-text-primary);
    margin-bottom: var(--zm-spacing-sm);
}

.zm-reading-meta {
    display: flex;
    align-items: center;
    gap: var(--zm-spacing-md);
}

.zm-reading-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--zm-secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.zm-reading-info {
    flex: 1;
}

.zm-reading-from {
    font-weight: 600;
    color: var(--zm-text-primary);
    font-size: var(--zm-font-size-lg);
}

.zm-reading-to {
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-secondary);
}

.zm-reading-date {
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-muted);
}

.zm-reading-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--zm-spacing-lg);
    font-size: var(--zm-font-size-lg);
    line-height: 1.6;
}

.zm-reading-body pre {
    white-space: pre-wrap;
    font-family: inherit;
}

/* Attachments */
.zm-attachments {
    padding: var(--zm-spacing-md);
    background: var(--zm-panel-bg);
    border-top: 1px solid var(--zm-border-light);
}

.zm-attachments-title {
    font-size: var(--zm-font-size-sm);
    font-weight: 600;
    color: var(--zm-text-secondary);
    margin-bottom: var(--zm-spacing-sm);
}

.zm-attachment-item {
    display: inline-flex;
    align-items: center;
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    background: var(--zm-app-bg);
    border: 1px solid var(--zm-border-light);
    border-radius: var(--zm-radius-sm);
    margin-right: var(--zm-spacing-sm);
    margin-bottom: var(--zm-spacing-sm);
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.zm-attachment-item:hover {
    background: var(--zm-hover-bg);
    border-color: var(--zm-secondary);
}

.zm-attachment-item i {
    margin-right: var(--zm-spacing-sm);
    color: var(--zm-text-secondary);
}

.zm-attachment-size {
    color: var(--zm-text-muted);
    margin-left: var(--zm-spacing-sm);
}

/* ========================================
   Compose Email
   ======================================== */

.zm-compose {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--zm-app-bg);
}

.zm-compose-header {
    padding: var(--zm-spacing-md);
    border-bottom: 1px solid var(--zm-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zm-compose-title {
    font-size: var(--zm-font-size-xl);
    font-weight: 600;
}

.zm-compose-actions {
    display: flex;
    gap: var(--zm-spacing-sm);
}

.zm-compose-fields {
    padding: var(--zm-spacing-md);
    border-bottom: 1px solid var(--zm-border-light);
}

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

.zm-compose-field:last-child {
    border-bottom: none;
}

.zm-compose-field label {
    width: 80px;
    font-size: var(--zm-font-size-md);
    color: var(--zm-text-secondary);
    flex-shrink: 0;
}

.zm-compose-field input {
    flex: 1;
    border: none;
    padding: var(--zm-spacing-sm);
    font-size: var(--zm-font-size-md);
    background: transparent;
}

.zm-compose-field input:focus {
    outline: none;
}

.zm-compose-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.zm-compose-body textarea {
    flex: 1;
    border: none;
    padding: var(--zm-spacing-md);
    font-size: var(--zm-font-size-lg);
    font-family: inherit;
    line-height: 1.6;
    resize: none;
}

.zm-compose-body textarea:focus {
    outline: none;
}

.zm-compose-attachments {
    padding: var(--zm-spacing-md);
    border-top: 1px solid var(--zm-border-light);
    background: var(--zm-panel-bg);
}

/* ========================================
   Empty States
   ======================================== */

.zm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--zm-spacing-xl);
    color: var(--zm-text-muted);
    text-align: center;
}

.zm-empty-state i {
    font-size: 64px;
    margin-bottom: var(--zm-spacing-md);
    opacity: 0.5;
}

.zm-empty-state h3 {
    font-size: var(--zm-font-size-xl);
    font-weight: 600;
    color: var(--zm-text-secondary);
    margin-bottom: var(--zm-spacing-sm);
}

.zm-empty-state p {
    font-size: var(--zm-font-size-md);
}

/* ========================================
   Pagination
   ======================================== */

.zm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--zm-spacing-md);
    gap: var(--zm-spacing-sm);
    border-top: 1px solid var(--zm-border-light);
    background: var(--zm-panel-bg);
}

.zm-pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--zm-border-medium);
    background: var(--zm-app-bg);
    border-radius: var(--zm-radius-sm);
    color: var(--zm-text-primary);
    font-size: var(--zm-font-size-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.zm-pagination-btn:hover {
    background: var(--zm-hover-bg);
    border-color: var(--zm-secondary);
}

.zm-pagination-btn.active {
    background: var(--zm-secondary);
    border-color: var(--zm-secondary);
    color: white;
}

.zm-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zm-pagination-info {
    font-size: var(--zm-font-size-sm);
    color: var(--zm-text-muted);
}

/* ========================================
   Dropdown Menu
   ======================================== */

.zm-dropdown {
    position: relative;
    display: inline-block;
}

.zm-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 180px;
    background: var(--zm-app-bg);
    border: 1px solid var(--zm-border-light);
    border-radius: var(--zm-radius-sm);
    box-shadow: var(--zm-shadow-md);
    display: none;
}

.zm-dropdown.open .zm-dropdown-menu {
    display: block;
}

.zm-dropdown-item {
    display: flex;
    align-items: center;
    padding: var(--zm-spacing-sm) var(--zm-spacing-md);
    color: var(--zm-text-primary);
    text-decoration: none;
    font-size: var(--zm-font-size-md);
    cursor: pointer;
    transition: background 0.15s;
}

.zm-dropdown-item:hover {
    background: var(--zm-hover-bg);
}

.zm-dropdown-item i {
    width: 20px;
    margin-right: var(--zm-spacing-sm);
    color: var(--zm-text-secondary);
}

.zm-dropdown-divider {
    height: 1px;
    background: var(--zm-border-light);
    margin: var(--zm-spacing-xs) 0;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 991px) {
    .zm-login-container {
        flex-direction: column;
        max-width: 500px;
    }

    .zm-login-branding {
        padding: var(--zm-spacing-lg);
    }

    .zm-login-features {
        display: none;
    }

    .zm-sidebar {
        display: none;
    }

    .zm-reading-pane {
        min-width: auto;
    }
}

@media (max-width: 767px) {
    .zm-login-branding {
        display: none;
    }

    .zm-login-form-container {
        padding: var(--zm-spacing-md);
    }

    .zm-banner-nav {
        display: none;
    }

    .zm-toolbar {
        flex-wrap: wrap;
    }

    .zm-search-box {
        order: 1;
        width: 100%;
        max-width: none;
        margin-top: var(--zm-spacing-sm);
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.zm-text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zm-hidden {
    display: none !important;
}

.zm-flex {
    display: flex;
}

.zm-flex-1 {
    flex: 1;
}

.zm-gap-sm {
    gap: var(--zm-spacing-sm);
}

.zm-gap-md {
    gap: var(--zm-spacing-md);
}

.zm-mt-md {
    margin-top: var(--zm-spacing-md);
}

.zm-mb-md {
    margin-bottom: var(--zm-spacing-md);
}

/* ========================================
   CloudX Responsive Design
   ======================================== */

/* Tablet Styles (max-width: 1024px) */
@media (max-width: 1024px) {
    .gm-header-center {
        max-width: 400px;
        margin: 0 16px;
    }

    .gm-sidebar {
        width: 220px;
    }

    .gm-compose-btn {
        padding: 12px 20px;
    }

    .gm-compose-btn span {
        display: inline;
    }
}

/* Mobile Landscape / Small Tablet (max-width: 768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    .gm-header {
        padding: 0 12px;
        height: 60px;
    }

    .gm-header::before {
        height: 2px;
    }

    .gm-header-left {
        min-width: auto;
        gap: 4px;
    }

    .gm-logo-text {
        display: none;
    }

    .gm-logo-img {
        width: 32px;
        height: 32px;
        margin-right: 0;
    }

    .gm-header-center {
        flex: 1;
        max-width: none;
        margin: 0 12px;
    }

    .gm-search-form {
        height: 40px;
    }

    .gm-search-input {
        font-size: 14px;
    }

    .gm-status-indicator {
        display: none;
    }

    .gm-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Hide left rail on mobile */
    .gm-left-rail {
        display: none;
    }

    /* Sidebar becomes overlay on mobile */
    .gm-sidebar {
        position: fixed;
        top: 60px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 60px);
        z-index: 1000;
        box-shadow: var(--cx-shadow-xl);
        transition: left 0.3s ease;
    }

    .gm-sidebar.mobile-open {
        left: 0;
    }

    .gm-sidebar.collapsed {
        width: 280px;
        left: -280px;
    }

    .gm-sidebar::before {
        display: none;
    }

    /* Overlay backdrop */
    .gm-sidebar-overlay {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .gm-sidebar-overlay.active {
        display: block;
    }

    /* Main content full width */
    .gm-main {
        flex-direction: column;
    }

    .zm-content {
        border-radius: 0;
    }

    /* Avatar dropdown adjustments */
    .gm-avatar-dropdown {
        min-width: 280px;
        right: -40px;
    }

    .gm-app-grid-dropdown {
        min-width: 260px;
        right: -20px;
    }
}

/* Mobile Portrait (max-width: 480px) */
@media (max-width: 480px) {
    .gm-header {
        padding: 0 8px;
        height: 56px;
    }

    .gm-hamburger {
        width: 40px;
        height: 40px;
    }

    .gm-logo {
        padding: 4px 8px;
    }

    .gm-logo-img {
        width: 28px;
        height: 28px;
    }

    .gm-search-form {
        height: 36px;
        padding: 0 4px;
    }

    .gm-search-icon,
    .gm-search-options {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .gm-search-input {
        font-size: 13px;
        padding: 0 8px;
    }

    .gm-search-input::placeholder {
        font-size: 12px;
    }

    .gm-header-right {
        gap: 2px;
    }

    .gm-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Hide support icon on very small screens */
    .gm-icon-btn[title="Support"] {
        display: none;
    }

    .gm-avatar-btn {
        padding: 2px;
    }

    .gm-avatar {
        width: 32px;
        height: 32px;
    }

    .gm-avatar-letter {
        font-size: 13px;
    }

    /* Sidebar mobile optimizations */
    .gm-sidebar {
        width: 100%;
        left: -100%;
        top: 56px;
        height: calc(100vh - 56px);
    }

    .gm-sidebar.mobile-open {
        left: 0;
    }

    .gm-sidebar.collapsed {
        width: 100%;
        left: -100%;
    }

    .gm-compose-wrapper {
        padding: 16px 12px;
    }

    .gm-compose-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    .gm-folder-nav {
        padding: 0 4px;
    }

    .gm-folder-item {
        height: 44px;
        padding: 0 12px;
    }

    /* Dropdowns full width on mobile */
    .gm-avatar-dropdown {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        min-width: auto;
        width: calc(100% - 16px);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .gm-app-grid-dropdown {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        min-width: auto;
        width: calc(100% - 16px);
    }

    .gm-app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .gm-app-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .gm-app-item {
        padding: 12px 6px;
    }

    .gm-avatar-header {
        padding: 16px;
    }

    .gm-avatar-large {
        width: 56px;
        height: 56px;
    }

    .gm-avatar-large .gm-avatar-letter {
        font-size: 22px;
    }

    .gm-avatar-name {
        font-size: 16px;
    }

    /* Inbox message list mobile */
    .cx-message-list-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cx-header-left {
        gap: 10px;
    }

    .cx-folder-title {
        font-size: 13px;
    }

    .cx-message-count {
        font-size: 11px;
        padding: 3px 8px;
    }

    .cx-header-right {
        gap: 6px;
    }

    .cx-sort-select {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Message items mobile */
    .cx-message-item {
        padding: 12px;
    }

    .cx-sender-avatar {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }

    .cx-sender-avatar span {
        font-size: 13px;
    }

    .cx-message-checkbox {
        margin-right: 8px;
    }

    .cx-message-star {
        margin-right: 8px;
        font-size: 14px;
    }

    .cx-message-from {
        font-size: 13px;
    }

    .cx-message-date {
        font-size: 11px;
    }

    .cx-message-subject {
        font-size: 12px;
    }

    .cx-message-preview {
        font-size: 11px;
    }

    .cx-empty-state {
        padding: 60px 16px;
    }

    .cx-empty-icon {
        width: 80px;
        height: 80px;
    }

    .cx-empty-icon i {
        font-size: 32px;
    }

    .cx-empty-state h3 {
        font-size: 18px;
    }

    .cx-empty-state p {
        font-size: 13px;
    }

    /* Pagination mobile */
    .cx-pagination {
        padding: 12px;
        gap: 12px;
    }

    .cx-pagination-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .cx-pagination-info {
        font-size: 12px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .gm-folder-item {
        min-height: 48px;
    }

    .cx-message-item {
        min-height: 72px;
    }

    .gm-icon-btn,
    .gm-hamburger {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Print styles */
@media print {
    .gm-header,
    .gm-left-rail,
    .gm-sidebar,
    .cx-message-checkbox,
    .cx-message-star,
    .cx-pagination {
        display: none !important;
    }

    .gm-main {
        display: block;
    }

    .zm-content {
        width: 100%;
    }
}
