* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    height: 100vh;
    background: #f0f2f5;
}

.container {
    display: grid;
    grid-template-columns: 280px 1fr 250px;
    height: 100vh;
}

.sidebar {
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-right {
    border-right: 1px solid #e5e7eb;
}

.search-container {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    gap: 0.5rem;
}

.nav-item:hover {
    background: #f3f4f6;
}

.nav-item.active {
    background: #e3f2fd;
    color: #1976d2;
}

.main-content {
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: white;
    margin: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.message {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    background: #f3f4f6;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 70%;
}

.input-container {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
}

.message-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: white;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

.admin-controls, .department-controls {
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: none;
}

.admin-controls.visible, .department-controls.visible {
    display: block;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.analytics-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stat-item {
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.role-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: white;
    margin-right: 0.5rem;
}

.role-admin { background: #ef4444; }
.role-manager { background: #3b82f6; }
.role-user { background: #10b981; }

.online-users {
    padding: 1rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

.user-item:hover {
    background: #f3f4f6;
    border-radius: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* New Styles */
.integration-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem;
}

.voice-record {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    margin: 0.5rem 1rem;
}

.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.template-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 0.5rem 1rem;
}

.template-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}

.template-item:hover {
    background: #f3f4f6;
}

.advanced-analytics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    height: 200px;
}

.task-chat {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}

.task-chat.visible {
    display: flex;
    flex-direction: column;
}

.task-chat-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.system-modal,
.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.template-details {
    margin: 15px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 4px;
}

.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.modern-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.popup-close:hover {
    color: #1f2937;
}

.media-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.upload-preview {
    margin-top: 12px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}