/**
 * Omni-Channel Communication Manager Styles - IMPROVED COMPACT VERSION
 * Comprehensive styling for unified communication interface
 * Enhanced for better space utilization and user experience
 */

/* === RESET AND BASE STYLES === */
.omnichannel-interface-container * {
    box-sizing: border-box;
}

.omnichannel-interface-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
    color: #333;
}

/* === MAIN LAYOUT === */
.omnichannel-interface-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 8px; /* Smaller radius */
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Reduced shadow */
    border: 1px solid #e9ecef;
}

.omnichannel-interface-container .main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* === IMPROVED HEADER SECTION - Much more compact === */
.omnichannel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px; /* REDUCED from 20px 30px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    min-height: 60px; /* FIXED HEIGHT */
}

.omnichannel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="90" cy="90" r="1" fill="white" opacity="0.05"/><circle cx="50" cy="30" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.header-stats {
    display: flex;
    gap: 10px; /* REDUCED from 15px */
    align-items: center;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: rgba(255,255,255,0.15);
    border-radius: 8px; /* REDUCED from 12px */
    padding: 8px 12px; /* REDUCED from 16px 20px */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 60px; /* REDUCED from 80px */
    position: relative;
    overflow: hidden;
}

.stat-card::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;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px) scale(1.02); /* REDUCED movement */
    box-shadow: 0 6px 20px rgba(0,0,0,0.2); /* REDUCED shadow */
}

.stat-card.active {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25); /* REDUCED shadow */
    transform: translateY(-1px); /* REDUCED movement */
}

.stat-number {
    font-size: 20px; /* REDUCED from 28px */
    font-weight: 700;
    margin-bottom: 2px; /* REDUCED from 6px */
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 10px; /* REDUCED from 11px */
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-icon {
    font-size: 14px; /* REDUCED from 20px */
    margin-bottom: 2px; /* REDUCED from 6px */
    display: block;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* REDUCED from 20px */
    position: relative;
    z-index: 1;
}

.blink-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px; /* REDUCED from 10px 16px */
    background: rgba(255,255,255,0.15);
    border-radius: 20px; /* REDUCED from 25px */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 12px; /* ADDED smaller font */
}

.blink-indicator {
    width: 10px; /* REDUCED from 14px */
    height: 10px; /* REDUCED from 14px */
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5); /* REDUCED shadow */
}

.blink-indicator.active {
    background: #ffc107;
    animation: urgent-blink 1s infinite;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.8); /* REDUCED shadow */
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes urgent-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

.refresh-button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    width: 36px; /* REDUCED from 44px */
    height: 36px; /* REDUCED from 44px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(180deg);
}

/* === CONVERSATIONS SIDEBAR - Slightly narrower === */
.omnichannel-conversations {
    width: 350px; /* REDUCED from 380px */
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05); /* REDUCED shadow */
}

.conversation-header {
    padding: 15px 20px; /* REDUCED from 25px */
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

.conversation-header h3 {
    margin: 0 0 10px 0; /* REDUCED from 15px */
    font-size: 16px; /* REDUCED from 18px */
    font-weight: 600;
    color: #2c3e50;
}

.conversation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px; /* REDUCED from 12px */
    margin-top: 10px; /* REDUCED from 15px */
}

.conversation-controls select {
    padding: 6px 8px; /* REDUCED from 10px 12px */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 4px; /* REDUCED from 8px */
    font-size: 12px; /* REDUCED from 13px */
    background: white;
    transition: all 0.2s ease;
    font-weight: 500;
}

.conversation-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1); /* REDUCED shadow */
}

.conversation-search {
    padding: 15px 20px; /* REDUCED from 20px 25px */
    border-bottom: 1px solid #e9ecef;
    position: relative;
    background: #f8f9fa;
}

.conversation-search input {
    width: 100%;
    padding: 8px 15px 8px 35px; /* ADJUSTED padding */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 20px; /* REDUCED from 25px */
    font-size: 13px; /* REDUCED from 14px */
    background: white;
    transition: all 0.3s ease;
}

.conversation-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); /* REDUCED shadow */
    transform: translateY(-1px);
}

.conversation-search::before {
    content: '🔍';
    position: absolute;
    left: 30px; /* ADJUSTED */
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px; /* REDUCED */
    color: #666;
}

.search-clear {
    position: absolute;
    right: 25px; /* ADJUSTED */
    top: 50%;
    transform: translateY(-50%);
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px; /* REDUCED from 24px */
    height: 20px; /* REDUCED from 24px */
    cursor: pointer;
    font-size: 12px; /* REDUCED from 14px */
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.conversation-item {
    padding: 15px 20px; /* REDUCED from 20px 25px */
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.conversation-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.2s ease;
}

.conversation-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

.conversation-item.active {
    background: linear-gradient(to right, #e3f2fd, #f8f9fa);
    border-color: #bbdefb;
}

.conversation-item.active::before {
    background: #2196f3;
}

.conversation-item.unread {
    background: linear-gradient(to right, #fff3cd, #fffbf0);
    border-color: #ffeaa7;
    font-weight: 600;
}

.conversation-item.unread::before {
    background: #ffc107;
}

.conversation-channel {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* REDUCED from 6px */
    padding: 4px 8px; /* REDUCED from 6px 12px */
    border-radius: 12px; /* REDUCED from 15px */
    font-size: 10px; /* REDUCED from 10px - keep same */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px; /* REDUCED from 12px */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* REDUCED shadow */
}

.conversation-channel.whatsapp { 
    background: linear-gradient(135deg, #25d366, #128c7e); 
    color: white; 
}

.conversation-channel.email { 
    background: linear-gradient(135deg, #0073aa, #005177); 
    color: white; 
}

.conversation-channel.sms { 
    background: linear-gradient(135deg, #ff6b6b, #ee5a52); 
    color: white; 
}

.conversation-channel.contact_form { 
    background: linear-gradient(135deg, #6c757d, #545b62); 
    color: white; 
}

.conversation-channel.telephone { 
    background: linear-gradient(135deg, #ffd93d, #ffcd02); 
    color: #333; 
}

.conversation-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px; /* REDUCED from 15px */
    line-height: 1.3;
}

.conversation-preview {
    font-size: 12px; /* REDUCED from 13px */
    color: #6c757d;
    margin-bottom: 8px; /* REDUCED from 10px */
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px; /* REDUCED from 12px */
    color: #888;
}

.conversation-time {
    color: #999;
}

.unread-badge {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-radius: 10px; /* REDUCED from 12px */
    padding: 2px 6px; /* REDUCED from 4px 8px */
    font-size: 10px; /* REDUCED from 11px */
    font-weight: 700;
    min-width: 18px; /* REDUCED from 20px */
    text-align: center;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.3); /* REDUCED shadow */
}

.priority-indicator {
    position: absolute;
    top: 12px; /* ADJUSTED */
    right: 12px; /* ADJUSTED */
    width: 6px; /* REDUCED from 8px */
    height: 6px; /* REDUCED from 8px */
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.3); /* REDUCED shadow */
}

.priority-indicator.urgent {
    background: #dc3545;
    animation: urgent-pulse 1s infinite;
}

.priority-indicator.high {
    background: #fd7e14;
}

@keyframes urgent-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* === MESSAGES AREA === */
.omnichannel-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    overflow: hidden;
}

.no-conversation-selected {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.empty-state {
    text-align: center;
    padding: 40px 30px; /* REDUCED from 60px 40px */
    color: #6c757d;
    max-width: 500px;
}

.empty-icon {
    font-size: 48px; /* REDUCED from 64px */
    color: #dee2e6;
    margin-bottom: 20px; /* REDUCED from 25px */
    display: block;
}

.empty-state h3 {
    font-size: 20px; /* REDUCED from 24px */
    font-weight: 600;
    margin-bottom: 12px; /* REDUCED from 15px */
    color: #495057;
}

.empty-state p {
    font-size: 14px; /* REDUCED from 16px */
    line-height: 1.6;
    margin-bottom: 20px; /* REDUCED from 30px */
}

.quick-stats {
    display: flex;
    gap: 20px; /* REDUCED from 30px */
    justify-content: center;
    margin-top: 20px; /* REDUCED from 30px */
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 24px; /* REDUCED from 32px */
    font-weight: 700;
    color: #667eea;
    margin-bottom: 6px; /* REDUCED from 8px */
}

.stat-item span {
    font-size: 12px; /* REDUCED from 14px */
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conversation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === IMPROVED MESSAGE HEADER - Much more compact === */
.message-header {
    padding: 12px 20px; /* REDUCED from 25px 30px */
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* REDUCED shadow */
    min-height: 50px; /* FIXED HEIGHT - much smaller */
}

.customer-info h4 {
    margin: 0 0 4px 0; /* REDUCED from 8px */
    color: #2c3e50;
    font-size: 16px; /* REDUCED from 20px */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px; /* REDUCED from 12px */
}

.channel-indicator {
    padding: 2px 6px; /* REDUCED from 6px 10px */
    border-radius: 8px; /* REDUCED from 12px */
    font-size: 10px; /* REDUCED from 12px */
    font-weight: 700;
    text-transform: uppercase;
}

.priority-badge {
    padding: 2px 6px; /* REDUCED from 4px 8px */
    border-radius: 8px; /* REDUCED from 10px */
    font-size: 9px; /* REDUCED from 10px */
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px; /* REDUCED from 10px */
}

.priority-badge.urgent {
    background: #dc3545;
    color: white;
}

.priority-badge.high {
    background: #fd7e14;
    color: white;
}

.customer-details {
    font-size: 12px; /* REDUCED from 14px */
    color: #6c757d;
    display: flex;
    gap: 15px; /* REDUCED from 20px */
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px; /* REDUCED from 12px */
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px; /* REDUCED from 8px */
    padding: 6px 12px; /* REDUCED from 10px 16px */
    background: #f8f9fa;
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 4px; /* REDUCED from 8px */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px; /* REDUCED from 14px */
    font-weight: 500;
    color: #495057;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* REDUCED shadow */
}

.status-select {
    padding: 6px 10px; /* REDUCED from 8px 12px */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 4px; /* REDUCED from 6px */
    background: white;
    font-size: 12px; /* REDUCED from 14px */
    font-weight: 500;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px; /* REDUCED from 25px 30px */
    display: flex;
    flex-direction: column;
    gap: 15px; /* REDUCED from 20px */
    background: #fafbfc;
    min-height: 200px; /* ENSURE MINIMUM HEIGHT */
}

.message-list::-webkit-scrollbar {
    width: 6px; /* REDUCED from 8px */
}

.message-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px; /* REDUCED from 4px */
}

.date-separator {
    text-align: center;
    margin: 15px 0; /* REDUCED from 20px */
    position: relative;
    color: #6c757d;
    font-size: 11px; /* REDUCED from 12px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: 1;
}

.date-separator span {
    background: #fafbfc;
    padding: 0 12px; /* REDUCED from 15px */
    position: relative;
    z-index: 2;
}

.message-item {
    max-width: 75%;
    padding: 12px 16px; /* REDUCED from 16px 20px */
    border-radius: 16px; /* REDUCED from 20px */
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* REDUCED shadow */
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-item.inbound {
    align-self: flex-start;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}

.message-item.outbound {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 6px;
}

.message-item.note {
    align-self: center;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeaa7;
    color: #856404;
    max-width: 90%;
    text-align: center;
    font-style: italic;
    border-radius: 12px; /* REDUCED from 15px */
}

.message-content {
    margin-bottom: 6px; /* REDUCED from 8px */
    line-height: 1.5;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
}

.message-item.outbound .message-content a {
    color: #fff;
}

.message-meta {
    font-size: 10px; /* REDUCED from 11px */
    opacity: 0.7;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px; /* REDUCED from 6px */
}

.status-indicator {
    width: 10px; /* REDUCED from 12px */
    height: 10px; /* REDUCED from 12px */
    border-radius: 50%;
}

.status-indicator.sent {
    background: #28a745;
}

.status-indicator.delivered {
    background: #17a2b8;
}

.status-indicator.read {
    background: #6c757d;
}

.status-indicator.failed {
    background: #dc3545;
}

.media-link {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* REDUCED from 6px */
    padding: 6px 10px; /* REDUCED from 8px 12px */
    background: rgba(0,0,0,0.1);
    border-radius: 6px; /* REDUCED from 8px */
    text-decoration: none;
    margin-top: 6px; /* REDUCED from 8px */
    transition: all 0.2s ease;
}

.media-link:hover {
    background: rgba(0,0,0,0.2);
}

/* === IMPROVED MESSAGE COMPOSER - Much more compact for non-reply channels === */
.message-composer {
    border-top: 1px solid #e9ecef;
    padding: 15px 20px; /* REDUCED from 25px 30px */
    background: linear-gradient(to top, #ffffff, #f8f9fa);
}

.composer-disabled {
    text-align: center;
    padding: 15px; /* REDUCED from 40px */
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px; /* REDUCED from 12px */
    font-size: 13px; /* ADDED smaller font */
    border: 1px solid #e9ecef;
}

.composer-disabled .info-icon {
    margin-right: 8px;
    color: #17a2b8;
}

.composer-form {
    display: flex;
    gap: 12px; /* REDUCED from 15px */
    align-items: flex-end;
}

.composer-input {
    flex: 1;
}

.composer-input textarea {
    width: 100%;
    min-height: 60px; /* REDUCED from 80px */
    max-height: 120px; /* REDUCED from 150px */
    padding: 12px 16px; /* REDUCED from 16px 20px */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 16px; /* REDUCED from 20px */
    resize: vertical;
    font-family: inherit;
    font-size: 13px; /* REDUCED from 14px */
    line-height: 1.5;
    transition: all 0.3s ease;
    background: white;
}

.composer-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); /* REDUCED shadow */
    transform: translateY(-1px);
}

.composer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px; /* REDUCED from 10px */
}

.send-button {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px; /* REDUCED from 50px */
    height: 44px; /* REDUCED from 50px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3); /* REDUCED shadow */
}

.send-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 14px rgba(40, 167, 69, 0.4); /* REDUCED shadow */
}

.send-button:disabled {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.template-trigger {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px; /* REDUCED from 40px */
    height: 36px; /* REDUCED from 40px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px; /* REDUCED from 14px */
    font-weight: 700;
    transition: all 0.3s ease;
}

.template-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(108, 117, 125, 0.3); /* REDUCED shadow */
}

.email-options {
    margin-top: 12px; /* REDUCED from 15px */
}

.email-options input {
    width: 100%;
    padding: 8px 12px; /* REDUCED from 12px 16px */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 8px; /* REDUCED from 10px */
    font-size: 13px; /* REDUCED from 14px */
    transition: all 0.3s ease;
}

.email-options input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1); /* REDUCED shadow */
}

/* === SIDEBAR === */
.omnichannel-sidebar {
    width: 300px; /* REDUCED from 320px */
    background: white;
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -2px 0 8px rgba(0,0,0,0.05); /* REDUCED shadow */
}

.sidebar-header {
    padding: 20px; /* REDUCED from 25px */
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 14px; /* REDUCED from 16px */
    font-weight: 600;
    color: #2c3e50;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 20px; /* REDUCED from 24px */
    cursor: pointer;
    color: #6c757d;
    width: 28px; /* REDUCED from 32px */
    height: 28px; /* REDUCED from 32px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px; /* REDUCED from 25px */
}

.sidebar-section {
    margin-bottom: 25px; /* REDUCED from 30px */
}

.sidebar-section h5 {
    margin: 0 0 12px 0; /* REDUCED from 15px */
    color: #495057;
    font-size: 13px; /* REDUCED from 14px */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 6px; /* REDUCED from 8px */
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px; /* REDUCED from 10px */
}

.customer-details-full {
    display: flex;
    flex-direction: column;
    gap: 10px; /* REDUCED from 12px */
}

.detail-item {
    padding: 10px; /* REDUCED from 12px */
    background: #f8f9fa;
    border-radius: 6px; /* REDUCED from 8px */
    border-left: 4px solid #667eea;
}

.detail-item strong {
    color: #495057;
    font-weight: 600;
}

.template-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px; /* REDUCED from 8px */
}

.template-btn {
    padding: 10px 14px; /* REDUCED from 12px 16px */
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
    border-radius: 6px; /* REDUCED from 8px */
    cursor: pointer;
    font-size: 12px; /* REDUCED from 13px */
    text-align: left;
    transition: all 0.3s ease;
    font-weight: 500;
}

.template-btn:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(144, 202, 249, 0.3); /* REDUCED shadow */
}

/* === MODALS === */
.omnichannel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.modal-content {
    background: white;
    border-radius: 12px; /* REDUCED from 16px */
    width: 90%;
    max-width: 450px; /* REDUCED from 500px */
    box-shadow: 0 15px 35px rgba(0,0,0,0.3); /* REDUCED shadow */
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 25px; /* REDUCED from 25px 30px */
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.modal-header h4 {
    margin: 0;
    font-size: 16px; /* REDUCED from 18px */
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px; /* REDUCED from 28px */
    cursor: pointer;
    color: #6c757d;
    width: 32px; /* REDUCED from 36px */
    height: 32px; /* REDUCED from 36px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px; /* REDUCED from 30px */
}

.modal-body select,
.modal-body textarea,
.modal-body input {
    width: 100%;
    padding: 10px 14px; /* REDUCED from 12px 16px */
    border: 1px solid #e9ecef; /* REDUCED border */
    border-radius: 6px; /* REDUCED from 8px */
    font-size: 13px; /* REDUCED from 14px */
    transition: all 0.3s ease;
    margin-bottom: 12px; /* REDUCED from 15px */
}

.modal-body select:focus,
.modal-body textarea:focus,
.modal-body input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1); /* REDUCED shadow */
}

.modal-footer {
    padding: 15px 25px; /* REDUCED from 20px 30px */
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px; /* REDUCED from 15px */
    background: #f8f9fa;
}

.btn {
    padding: 10px 20px; /* REDUCED from 12px 24px */
    border: none;
    border-radius: 6px; /* REDUCED from 8px */
    cursor: pointer;
    font-size: 13px; /* REDUCED from 14px */
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3); /* REDUCED shadow */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.4); /* REDUCED shadow */
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3); /* REDUCED shadow */
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(108, 117, 125, 0.4); /* REDUCED shadow */
}

#note-templates {
    margin-top: 15px; /* REDUCED from 20px */
    padding-top: 15px; /* REDUCED from 20px */
    border-top: 1px solid #e9ecef;
}

#note-templates h5 {
    margin-bottom: 12px; /* REDUCED from 15px */
    font-size: 13px; /* REDUCED from 14px */
    color: #495057;
    font-weight: 600;
}

.note-template-btn {
    display: block;
    width: 100%;
    margin-bottom: 6px; /* REDUCED from 8px */
    padding: 8px 12px; /* REDUCED from 10px 15px */
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px; /* REDUCED from 6px */
    cursor: pointer;
    font-size: 12px; /* REDUCED from 13px */
    text-align: left;
    transition: all 0.2s ease;
}

.note-template-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.form-group {
    margin-bottom: 15px; /* REDUCED from 20px */
}

.form-group label {
    display: block;
    margin-bottom: 6px; /* REDUCED from 8px */
    font-weight: 600;
    color: #495057;
}

/* === LOADING STATES === */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px; /* REDUCED from 60px */
    color: #6c757d;
    gap: 12px; /* REDUCED from 15px */
    flex-direction: column;
}

.spinner {
    width: 28px; /* REDUCED from 32px */
    height: 28px; /* REDUCED from 32px */
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === TOAST NOTIFICATIONS === */
#toast-container {
    position: fixed;
    top: 20px; /* REDUCED from 30px */
    right: 20px; /* REDUCED from 30px */
    z-index: 10001;
    max-width: 350px; /* REDUCED from 400px */
}

.toast {
    background: white;
    border-radius: 8px; /* REDUCED from 12px */
    padding: 15px 20px; /* REDUCED from 20px 25px */
    margin-bottom: 12px; /* REDUCED from 15px */
    box-shadow: 0 6px 20px rgba(0,0,0,0.15); /* REDUCED shadow */
    border-left: 4px solid #667eea;
    animation: toastSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.toast.success {
    border-left-color: #28a745;
}

.toast.success::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.error::before {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.warning::before {
    background: linear-gradient(90deg, #ffc107, #ffcd02);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1200px) {
    .omnichannel-conversations {
        width: 320px; /* REDUCED from 350px */
    }
    
    .omnichannel-sidebar {
        width: 260px; /* REDUCED from 280px */
    }
    
    .stat-card {
        min-width: 50px; /* REDUCED */
        padding: 6px 10px; /* REDUCED */
    }
    
    .stat-number {
        font-size: 16px; /* REDUCED */
    }
    
    .header-stats {
        gap: 8px; /* REDUCED */
    }
}

@media (max-width: 768px) {
    .omnichannel-interface-container {
        flex-direction: column;
        height: auto;
        min-height: 500px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .omnichannel-conversations,
    .omnichannel-sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .omnichannel-header {
        padding: 10px 15px; /* REDUCED */
        flex-direction: column;
        gap: 12px; /* REDUCED */
    }
    
    .header-stats {
        flex-wrap: wrap;
        gap: 8px; /* REDUCED */
        justify-content: center;
    }
    
    .stat-card {
        min-width: 55px; /* REDUCED */
        padding: 6px 10px; /* REDUCED */
    }
    
    .stat-number {
        font-size: 16px; /* REDUCED */
    }
    
    .stat-label {
        font-size: 9px; /* REDUCED */
    }
    
    .conversation-controls {
        grid-template-columns: 1fr;
        gap: 6px; /* REDUCED */
    }
    
    .conversation-search {
        padding: 12px 15px; /* REDUCED */
    }
    
    .conversation-item {
        padding: 12px 15px; /* REDUCED */
    }
    
    .message-header {
        padding: 15px; /* REDUCED */
        flex-direction: column;
        align-items: flex-start;
        gap: 10px; /* REDUCED */
    }
    
    .customer-details {
        flex-direction: column;
        gap: 6px; /* REDUCED */
    }
    
    .message-list {
        padding: 15px; /* REDUCED */
    }
    
    .message-composer {
        padding: 15px; /* REDUCED */
    }
    
    .composer-form {
        flex-direction: column;
        gap: 12px; /* REDUCED */
    }
    
    .composer-actions {
        flex-direction: row;
        justify-content: center;
        gap: 12px; /* REDUCED */
    }
    
    .modal-content {
        width: 95%;
        margin: 15px; /* REDUCED */
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px; /* REDUCED */
    }
    
    #toast-container {
        top: 15px; /* REDUCED */
        right: 15px; /* REDUCED */
        left: 15px; /* REDUCED */
        max-width: none;
    }
}

@media (max-width: 480px) {
    .conversation-channel {
        font-size: 9px;
        padding: 3px 6px; /* REDUCED */
    }
    
    .message-item {
        max-width: 90%;
        padding: 10px 14px; /* REDUCED */
    }
    
    .quick-stats {
        flex-direction: column;
        gap: 15px; /* REDUCED */
    }
    
    .stat-item strong {
        font-size: 20px; /* REDUCED */
    }
}

/* === PRINT STYLES === */
@media print {
    .omnichannel-interface-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .omnichannel-header,
    .conversation-controls,
    .message-composer,
    .omnichannel-sidebar {
        display: none;
    }
    
    .message-list {
        padding: 15px; /* REDUCED */
        background: white;
    }
    
    .message-item {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 8px; /* REDUCED */
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .omnichannel-interface-container {
        border: 2px solid #000;
    }
    
    .stat-card {
        border: 2px solid rgba(255,255,255,0.5);
    }
    
    .conversation-item {
        border-bottom: 2px solid #000;
    }
    
    .message-item {
        border: 2px solid #666;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .blink-indicator {
        animation: none;
    }
    
    .priority-indicator.urgent {
        animation: none;
    }
}