:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --text: #eaeaea;
    --text-muted: #a0a0a0;
    --border: #2a2a3e;
    --success: #4caf50;
    --warning: #ff9800;
    --bg-sidebar: #16162a;
    --bg-main: #1e1e32;
    --bg-input: #252540;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    height: 60px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-weight: 500;
}

/* Main Layout */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    overflow-y: auto;
}

.section {
    margin-bottom: 24px;
    padding: 0 16px;
}

.section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 8px;
}

.channel-list, .team-list {
    list-style: none;
}

.channel-item, .team-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.channel-item:hover, .team-member:hover {
    background: rgba(255,255,255,0.05);
}

.channel-item.active {
    background: var(--accent);
}

.channel-icon, .member-avatar {
    font-size: 18px;
}

.channel-name, .member-name {
    font-size: 14px;
    flex: 1;
}

.member-status {
    font-size: 10px;
    color: var(--text-muted);
}

.member-status.online {
    color: var(--success);
}

.action-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--highlight);
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.channel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.channel-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.channel-description {
    color: var(--text-muted);
    font-size: 14px;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.message {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    font-size: 36px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    font-size: 15px;
}

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

.message-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

/* Input Area */
.input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
}

.attach-btn, .send-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.attach-btn:hover, .send-btn:hover {
    opacity: 1;
}

.send-btn {
    color: var(--highlight);
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.input-hints {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding-left: 8px;
}

.input-hints span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Context Panel */
.context-panel {
    width: 300px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.deal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.deal-status {
    font-size: 10px;
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--highlight);
}

.ai-summary {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-summary p {
    margin-bottom: 8px;
}

.ai-summary p:last-child {
    margin-bottom: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .context-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

.dashboard-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.dashboard-header .date {
    color: var(--text-muted);
    font-size: 14px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 24px 32px;
}

.metric-card {
    background: var(--bg-sidebar);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 20px;
    border: 1px solid var(--border);
}

.metric-icon {
    font-size: 48px;
}

.metric-content h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.metric-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.metric-breakdown b {
    color: var(--text);
}

.metric-breakdown .overdue {
    color: var(--highlight);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 32px 32px;
}

.section-card {
    background: var(--bg-sidebar);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.view-all {
    font-size: 13px;
    color: var(--highlight);
    text-decoration: none;
}

.action-list, .task-list, .deal-list {
    padding: 16px;
}

.empty {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 24px;
}

/* Deal Card */
.deal-card {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.deal-card h4 {
    font-size: 15px;
    margin-bottom: 8px;
}

.deal-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.deal-progress {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.deal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight), #ff6b6b);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ============================================
   KANBAN STYLES
   ============================================ */

.kanban-header, .deals-header {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.kanban-header h1, .deals-header h1 {
    font-size: 24px;
}

.btn-primary {
    background: var(--highlight);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 24px 32px;
    height: calc(100vh - 140px);
    overflow-x: auto;
}

.kanban-column {
    background: var(--bg-sidebar);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.column-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-title {
    font-size: 14px;
    font-weight: 600;
}

.column-count {
    background: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.column-tasks {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.task-card {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: var(--accent);
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.priority-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.priority-low { background: var(--success); color: white; }
.priority-medium { background: var(--warning); color: black; }
.priority-high { background: #ff5722; color: white; }
.priority-urgent { background: var(--highlight); color: white; }

/* ============================================
   PIPELINE STYLES
   ============================================ */

.pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 24px 32px;
    height: calc(100vh - 140px);
    overflow-x: auto;
}

.pipeline-stage {
    background: var(--bg-sidebar);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.stage-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stage-name {
    font-size: 14px;
    font-weight: 600;
}

.stage-count {
    background: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.stage-deals {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-sidebar);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text);
}

.modal form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--highlight);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
}

.nav-item.active {
    background: rgba(233, 69, 96, 0.1);
    border-left-color: var(--highlight);
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 14px;
}

/* ============================================
   VIEW SWITCHING
   ============================================ */

.view {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.view.active {
    display: block;
}
