/* ==========================================================================
   The Brand Habit - Component Library (Cards, Tables, Forms, Modals, Buttons)
   ========================================================================== */

/* Cards & Containers */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #FAFAFA;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #FAFAFA;
}

/* Form Inputs & Controls */
.input, .form-control, .form-select, select.input, textarea.input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-main);
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .form-control:focus, .form-select:focus, textarea.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

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

.form-label, label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-label .required, label .required, .required {
    color: var(--danger);
    font-weight: 700;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
    font-weight: 500;
}

/* Password Input Visibility Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input,
.password-input-wrapper .input,
.password-input-wrapper .form-control {
    width: 100%;
    padding-right: 42px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s ease, background-color 0.15s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Data Tables */
.table-brand, .table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8125rem;
}

.table-brand th, .table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table-brand td, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.table-brand tbody tr:hover, .table tbody tr:hover {
    background-color: #F8FAFC;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF !important;
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #FFFFFF !important;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--text-main) !important;
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #F1F5F9;
    color: var(--text-main) !important;
    border-color: #CBD5E1;
}

.btn-success {
    background-color: var(--success);
    color: #FFFFFF !important;
    border-color: var(--success);
}
.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: #FFFFFF !important;
}

.btn-danger {
    background-color: var(--danger);
    color: #FFFFFF !important;
    border-color: var(--danger);
}
.btn-danger:hover {
    background-color: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF !important;
}

.btn-warning {
    background-color: var(--warning);
    color: #FFFFFF !important;
    border-color: var(--warning);
}
.btn-warning:hover {
    background-color: #D97706;
    border-color: #D97706;
    color: #FFFFFF !important;
}

.btn-whatsapp {
    background-color: #25D366;
    color: #FFFFFF !important;
    border-color: #25D366;
}
.btn-whatsapp:hover {
    background-color: #128C7E;
    border-color: #128C7E;
    color: #FFFFFF !important;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary) !important;
    border-color: var(--primary-border);
}
.btn-outline-primary:hover {
    background-color: var(--primary-light);
    color: var(--primary) !important;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 0.9375rem;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.show {
    display: flex;
}

.modal-dialog {
    background-color: #FFFFFF;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Slide-Over Quick Drawer */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.slide-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 580px;
    background-color: #FFFFFF;
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.15);
    border-left: 1px solid var(--border-color);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    visibility: hidden;
}

.slide-drawer.show {
    transform: translateX(0);
    visibility: visible;
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: #FAFAFA;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 7px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    border: 3px solid var(--primary);
}

.timeline-dot.dot-success { border-color: var(--success); }
.timeline-dot.dot-danger { border-color: var(--danger); }
.timeline-dot.dot-warning { border-color: var(--warning); }

.timeline-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

/* ==========================================================================
/* ==========================================================================
   Perfex CRM Style Interactive Dashboard Calendar (Compact & Minimized)
   ========================================================================== */
.perfex-cal-card {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    overflow: hidden;
}

.perfex-cal-topbar {
    padding: 10px 16px;
    background: #FAFAFA;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.perfex-cal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.perfex-cal-month-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1E293B;
    min-width: 140px;
    text-align: center;
}

.perfex-cal-filter-tabs {
    display: flex;
    background: #EEF2F6;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.perfex-cal-tab {
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.perfex-cal-tab.active, .perfex-cal-tab:hover {
    background: #FFFFFF;
    color: #2563EB;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.perfex-cal-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    font-size: 0.7rem;
}

.perfex-cal-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #334155;
    font-weight: 600;
    font-size: 0.6875rem;
}

.perfex-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #E2E8F0;
    gap: 1px;
}

.perfex-cal-weekday {
    background: #F8FAFC;
    padding: 5px 4px;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perfex-cal-cell {
    background: #FFFFFF;
    min-height: 46px;
    max-height: 60px;
    padding: 3px 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: background-color 0.15s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.perfex-cal-cell:hover {
    background-color: #F8FAFC;
}

.perfex-cal-cell.other-month {
    background-color: #FAFAFA;
    opacity: 0.45;
}

.perfex-cal-cell.today {
    background-color: #F0F7FF;
}

.perfex-cal-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
    line-height: 1;
}

.perfex-cal-day-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.perfex-cal-cell.today .perfex-cal-day-num {
    background: #2563EB;
    color: #FFFFFF;
}

.perfex-cal-quick-add {
    opacity: 0;
    font-size: 0.6875rem;
    color: #94A3B8;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    padding: 0 3px;
    border-radius: 3px;
    transition: all 0.15s ease;
    line-height: 1;
}

.perfex-cal-cell:hover .perfex-cal-quick-add {
    opacity: 1;
}

.perfex-cal-quick-add:hover {
    color: #2563EB;
    background: #EEF2FF;
}

.perfex-cal-events-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.perfex-cal-micro-pill {
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.625rem;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
    border-left: 2px solid transparent;
    text-decoration: none;
}

.perfex-cal-micro-pill.perfex-cal-pill-post {
    background: #F0FDF4;
    color: #166534;
    border-left-color: #22C55E;
}

.perfex-cal-micro-pill.perfex-cal-pill-post.at-risk {
    background: #FEF2F2;
    color: #991B1B;
    border-left-color: #EF4444;
}

.perfex-cal-micro-pill.perfex-cal-pill-task {
    background: #F5F3FF;
    color: #5B21B6;
    border-left-color: #8B5CF6;
}

.perfex-cal-micro-pill.perfex-cal-pill-task.high {
    background: #FFF1F2;
    color: #9F1239;
    border-left-color: #F43F5E;
}

.perfex-cal-micro-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.625rem;
    font-weight: 600;
    color: #4F46E5;
    background: #EEF2FF;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    line-height: 1.2;
    width: fit-content;
}

.perfex-cal-pill {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
    border-left: 2px solid transparent;
    transition: transform 0.1s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.perfex-cal-pill:hover {
    transform: translateX(1px);
}

.perfex-cal-pill-post {
    background: #F0FDF4;
    color: #166534;
    border-left-color: #22C55E;
}

.perfex-cal-pill-post.at-risk {
    background: #FEF2F2;
    color: #991B1B;
    border-left-color: #EF4444;
}

.perfex-cal-pill-task {
    background: #F5F3FF;
    color: #5B21B6;
    border-left-color: #8B5CF6;
}

.perfex-cal-pill-task.high {
    background: #FFF1F2;
    color: #9F1239;
    border-left-color: #F43F5E;
}

.perfex-cal-more-btn {
    font-size: 0.5875rem;
    font-weight: 700;
    color: #2563EB;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    line-height: 1;
}

.perfex-cal-more-btn:hover {
    text-decoration: underline;
}

/* Collapsible state */
.perfex-cal-card.minimized .perfex-cal-body {
    display: none;
}
.perfex-cal-card.minimized .perfex-cal-collapsed-banner {
    display: flex;
}
.perfex-cal-collapsed-banner {
    display: none;
    padding: 8px 16px;
    background: #F8FAFC;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748B;
}

/* ==========================================================================
   Project 360 Management View Components (Pipeline, KPIs, Tabs, Stakeholders)
   ========================================================================== */

/* Project Hero Header */
.project-hero-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

/* Visual Stage Pipeline */
.pipeline-wrapper {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 24px;
    overflow-x: auto;
}

.pipeline-stepper {
    display: flex;
    align-items: stretch;
    min-width: 750px;
    gap: 8px;
    position: relative;
}

.pipeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    position: relative;
    transition: all 0.2s ease;
}

.pipeline-step.completed {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.pipeline-step.active {
    background: #EEF2FF;
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.pipeline-step.upcoming {
    background: #FAFAFA;
    border-color: #E2E8F0;
    opacity: 0.85;
}

.pipeline-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.pipeline-step.completed .pipeline-step-badge {
    background: #16A34A;
    color: #FFFFFF;
}

.pipeline-step.active .pipeline-step-badge {
    background: #4F46E5;
    color: #FFFFFF;
    animation: pulseGlow 2s infinite;
}

.pipeline-step.upcoming .pipeline-step-badge {
    background: #E2E8F0;
    color: #64748B;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.pipeline-step-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.25;
    margin-bottom: 4px;
}

.pipeline-step.completed .pipeline-step-title {
    color: #15803D;
}

.pipeline-step.active .pipeline-step-title {
    color: #4338CA;
}

.pipeline-step.upcoming .pipeline-step-title {
    color: #64748B;
}

.pipeline-step-meta {
    font-size: 0.6875rem;
    color: #64748B;
}

/* KPI 4-Card Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.kpi-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
}

.kpi-card-icon {
    font-size: 1.125rem;
}

.kpi-card-value {
    font-size: 1.625rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
    margin-bottom: 6px;
}

.kpi-progress-track {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 6px;
}

.kpi-progress-fill {
    height: 100%;
    background: #4F46E5;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.kpi-card-subtitle {
    font-size: 0.75rem;
    color: #64748B;
}

/* Project Workspace Tabs */
.project-tabs-container {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    overflow: hidden;
    margin-bottom: 24px;
}

.project-nav-tabs {
    display: flex;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
    padding: 0 16px;
    gap: 4px;
    overflow-x: auto;
}

.project-nav-tab {
    padding: 14px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748B;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
}

.project-nav-tab:hover {
    color: #1E293B;
}

.project-nav-tab.active {
    color: #4F46E5;
    border-bottom-color: #4F46E5;
    background: #FFFFFF;
}

.project-tab-badge {
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: #EEF2F6;
    color: #475569;
}

.project-nav-tab.active .project-tab-badge {
    background: #EEF2FF;
    color: #4F46E5;
}

.project-tab-pane {
    display: none;
    padding: 20px;
}

.project-tab-pane.active {
    display: block;
}

/* Google Drive Link Button */
.btn-drive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #F0FDF4;
    color: #15803D !important;
    border: 1px solid #86EFAC;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-drive:hover {
    background: #DCFCE7;
    border-color: #4ADE80;
    color: #166534 !important;
}

/* User Avatar Initials */
.user-avatar-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #334155;
}

.user-avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #C7D2FE;
}

/* ==========================================================================
   Basecamp & ClickUp Chat & Campfire Module Styles
   ========================================================================== */

.chat-container {
    display: flex;
    height: calc(100vh - 120px);
    min-height: 560px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Left Sidebar: Channels & DMs */
.chat-sidebar {
    width: 300px;
    min-width: 280px;
    background: #F8FAFC;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
}

.chat-search-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    font-size: 0.8125rem;
    background: #F8FAFC;
    transition: all 0.15s ease;
}

.chat-search-input:focus {
    outline: none;
    border-color: #6366F1;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.chat-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.chat-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748B;
    padding: 10px 10px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-channel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.chat-channel-link:hover {
    background: #EEF2F6;
    color: #0F172A;
}

.chat-channel-link.active {
    background: #EEF2FF;
    color: #4F46E5;
    font-weight: 600;
}

.chat-channel-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-unread-badge {
    background: #6366F1;
    color: #FFFFFF;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1;
}

/* Center Message Stream */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.chat-main-header {
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    z-index: 10;
}

.chat-pinned-banner {
    background: #FFFBEB;
    border-bottom: 1px solid #FDE68A;
    padding: 8px 20px;
    font-size: 0.8125rem;
    color: #92400E;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #FFFFFF;
}

/* Individual Message Row */
.chat-msg-row {
    display: flex;
    gap: 12px;
    position: relative;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.chat-msg-row:hover {
    background-color: #F8FAFC;
}

.chat-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4F46E5;
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-msg-content {
    flex: 1;
    min-width: 0;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-msg-author {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0F172A;
}

.chat-msg-badge {
    font-size: 0.6875rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #475569;
    font-weight: 600;
}

.chat-msg-time {
    font-size: 0.75rem;
    color: #94A3B8;
}

.chat-msg-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Floating message actions on hover */
.chat-msg-actions {
    position: absolute;
    top: -12px;
    right: 16px;
    display: none;
    align-items: center;
    gap: 4px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 2px 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.chat-msg-row:hover .chat-msg-actions {
    display: flex;
}

.chat-action-btn {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 12px;
    color: #64748B;
    transition: all 0.15s ease;
}

.chat-action-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Attachments */
.chat-attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-attachment-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2563EB;
    text-decoration: none;
    transition: all 0.15s ease;
}

.chat-attachment-card:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #1D4ED8;
}

.chat-attachment-card.figma {
    background: #FFF1F2;
    border-color: #FECDD3;
    color: #E11D48;
}

.chat-attachment-card.figma:hover {
    background: #FFE4E6;
}

.chat-attachment-card.drive {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #16A34A;
}

.chat-attachment-card.drive:hover {
    background: #DCFCE7;
}

/* Reaction Pills */
.chat-reactions-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.chat-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-reaction-pill:hover {
    background: #E2E8F0;
}

.chat-reaction-pill.reacted {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
}

/* Input Area */
.chat-input-container {
    padding: 14px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.chat-input-box {
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 12px;
    background: #FFFFFF;
    transition: border-color 0.15s ease;
}

.chat-input-box:focus-within {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.chat-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.4;
    max-height: 140px;
    min-height: 38px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #F1F5F9;
}

.chat-tools-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-tool-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.chat-tool-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Right Drawer: Channel Details & Assets */
.chat-drawer {
    width: 280px;
    border-left: 1px solid #E2E8F0;
    background: #F8FAFC;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-drawer-section {
    padding: 16px;
    border-bottom: 1px solid #E2E8F0;
}

.chat-drawer-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Enhanced Markdown & Elements */
.chat-inline-code {
    background: #F1F5F9;
    color: #E11D48;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.chat-code-block {
    background: #0F172A;
    color: #E2E8F0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow-x: auto;
    margin: 6px 0;
}

.chat-edited-badge {
    font-size: 0.6875rem;
    color: #94A3B8;
    font-style: italic;
}

.chat-user-mention {
    background: #EEF2FF;
    color: #4F46E5;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.chat-task-mention {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #F0FDF4;
    color: #166534;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #BBF7D0;
}

.chat-task-mention:hover {
    background: #DCFCE7;
}

.chat-linked-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    padding: 4px 10px;
    border-radius: 6px;
    color: #4338CA;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.chat-linked-task-chip:hover {
    background: #E0E7FF;
    border-color: #818CF8;
}

/* Image Thumbnails & Previews */
.chat-image-preview-card {
    max-width: 260px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
}

.chat-image-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chat-image-thumb:hover {
    opacity: 0.95;
}

.chat-image-meta {
    padding: 4px 8px;
    font-size: 0.6875rem;
    color: #64748B;
    background: #FFFFFF;
    border-top: 1px solid #F1F5F9;
    display: flex;
    justify-content: space-between;
}

/* File Upload Preview Strip before send */
.chat-file-preview-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.chat-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.chat-file-remove-btn {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 2px;
}

/* Interactive @Mention Autocomplete Menu */
.chat-mention-dropdown {
    scrollbar-width: thin;
    animation: mentionFadeIn 0.15s ease-out;
}

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

.chat-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid transparent;
}

.chat-mention-item:hover, .chat-mention-item.active {
    background: #EEF2FF;
    border-color: #C7D2FE;
}

.chat-mention-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #FFFFFF;
    flex-shrink: 0;
}

.chat-mention-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-mention-name {
    font-weight: 600;
    color: #1E293B;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.chat-mention-role {
    font-size: 0.6875rem;
    color: #64748B;
}

.chat-mention-tag {
    margin-left: auto;
    font-size: 0.6875rem;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-weight: 600;
    color: #4F46E5;
    background: #E0E7FF;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}




