/* Dashboard Module Styles */

/* Dashboard Header Override */
.dashboard-app .chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   Dashboard Grid Layouts
   ============================================ */

.dashboard-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-right {
    flex: 1;
    min-width: 300px;
    max-width: 380px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

.widget-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 2px dashed var(--color-gray-200);
}

/* Dashboard 2+1 Layout (left grid + right activity) */
.dashboard-layout {
    display: flex;
    gap: 1.5rem;
}

.dashboard-left-grid {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.dashboard-left-grid .widget-card {
    min-height: 160px;
}

.dashboard-right-activity {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

.widget-activity-tall {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.widget-activity-tall .activity-list {
    flex: 1;
    overflow-y: auto;
    max-height: calc(160px * 3 + 2rem);
}

/* Widgets Row */
.widgets-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* ============================================
   Pipeline / Funnel Components
   ============================================ */

.pipeline-section {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.pipeline-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.pipeline-stage {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(var(--stage-rgb), 0.08), rgba(var(--stage-rgb), 0.03));
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.pipeline-stage:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.pipeline-stage:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
}

.pipeline-stage:hover {
    background: linear-gradient(135deg, rgba(var(--stage-rgb), 0.15), rgba(var(--stage-rgb), 0.08));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: var(--stage-color);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.stage-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1.2;
}

.stage-label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    white-space: nowrap;
}

.stage-arrow {
    color: var(--color-gray-500);
    font-size: 0.75rem;
}

.pipeline-stage:last-child .stage-arrow {
    display: none;
}

/* ============================================
   Widget & Chart Cards
   ============================================ */

.widget-card {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.widget-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-card h3 i {
    opacity: 0.7;
}

.widget-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-gray-500);
    margin-left: auto;
}

/* Widget Tabs */
.widget-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--color-gray-100);
    border-radius: 0.375rem;
    padding: 0.125rem;
}

.widget-tab-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--color-gray-600);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.widget-tab-btn:hover {
    color: var(--color-gray-800);
}

.widget-tab-btn.active {
    background: var(--color-white);
    color: var(--color-gray-900);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Company Calendar schedule item styling */
.schedule-item-calendar {
    border-left: 3px solid var(--color-info) !important;
}

.schedule-item-calendar .schedule-date {
    border-color: var(--color-info) !important;
}

/* ============================================
   Activity / Feed Lists
   ============================================ */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-gray-50);
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: var(--color-gray-100);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.activity-text {
    font-size: 0.8rem;
    color: var(--color-gray-900);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.7rem;
    color: var(--color-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--color-gray-500);
    white-space: nowrap;
}

/* ============================================
   Schedule Items
   ============================================ */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-day {
    font-size: 0.65rem;
    color: var(--color-gray-500);
    text-transform: uppercase;
    font-weight: 500;
}

.schedule-date-num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1;
}

.schedule-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.schedule-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-time {
    font-size: 0.7rem;
    color: var(--color-gray-500);
}

.schedule-status {
    color: var(--color-gray-500);
    font-size: 0.9rem;
}

.schedule-status.in-progress {
    color: var(--color-primary);
}

.schedule-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-primary);
    text-decoration: none;
    border-top: 1px solid var(--color-gray-300);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.schedule-view-all:hover {
    color: var(--color-primary-dark);
}

/* ============================================
   Funnel Components
   ============================================ */

.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.funnel-stage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.funnel-bar {
    height: 32px;
    width: var(--funnel-width, 100%);
    min-width: 60px;
    background: var(--funnel-color, var(--color-gray-500));
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.75rem;
    transition: width 0.5s ease;
}

.funnel-value {
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 600;
}

.funnel-label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    white-space: nowrap;
    min-width: 100px;
}

/* ============================================
   Aging Summary
   ============================================ */

.aging-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aging-total {
    text-align: center;
    padding: 1rem;
    background: var(--color-gray-50);
    border-radius: 0.5rem;
}

.aging-total-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.aging-total-label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.aging-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.aging-bucket {
    text-align: center;
}

.aging-bucket-bar {
    background: var(--bucket-color, var(--color-gray-500));
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
}

.aging-bucket-value {
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 600;
}

.aging-bucket-label {
    font-size: 0.7rem;
    color: var(--color-gray-500);
}

/* ============================================
   Sidebar Editing (Dashboard Nav Only)
   ============================================ */

/* Bottom controls container */
.nav-bottom-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

/* Lock/Unlock and Reset buttons at bottom of sidebar */
.nav-lock {
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-gray-400);
    transition: color 0.2s;
    background: var(--color-white);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-lock:hover {
    color: var(--color-gray-600);
    background: var(--color-gray-100);
}

/* Nav item visibility checkbox (edit mode) */
.nav-item-checkbox {
    margin-left: 1rem;
    margin-right: 0;
    cursor: pointer;
    accent-color: var(--color-gray-400);
    flex-shrink: 0;
    opacity: 0.6;
}

/* Dimmed appearance for hidden items (in edit mode) */
.nav-item-hidden .nav-link {
    opacity: 0.4;
    text-decoration: line-through;
}

/* Editing mode styling */
.sidebar-editing .nav-section {
    border: 1px dashed var(--color-gray-300);
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem;
    padding: 0.25rem;
    transition: border-color 0.2s;
}

.sidebar-editing .nav-section:hover {
    border-color: var(--color-primary);
}
