/* ==================== CRM DETAIL OVERLAY ==================== */
/* Unified styling with product focus panel – orange theme */
.crm-detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--theme-card-border);
    z-index: 3000;
    display: none;
    flex-direction: column;
    padding: 18px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.crm-detail-panel.visible {
    display: flex;
}

.crm-detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
}

.crm-detail-panel-header h3 {
    margin: 0;
    color: var(--text-dark); /* changed from accent to dark */
    font-size: 1.4rem;
}

.crm-detail-panel-header h3 i {
    color: var(--theme-accent); /* icon stays orange */
}

.crm-detail-header-actions {
    display: flex;
    gap: 8px;
}

.crm-detail-panel-content {
    flex: 1;
    display: grid;
    grid-template-columns: 0.88fr 1.84fr 2.37fr;
    gap: 15px;
    min-height: 0;
    overflow: hidden;
}

.crm-detail-left-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.crm-detail-functions {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.crm-detail-functions:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

.crm-detail-functions h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--theme-accent);
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    padding-bottom: 4px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-detail-function-item {
    background: color-mix(in srgb, var(--theme-accent) 5%, transparent);
    border: 1px solid var(--theme-accent);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    color: var(--theme-accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    text-align: center;
}

.crm-detail-function-item i {
    width: 20px;
    font-size: 1.1rem;
}

.crm-detail-function-item:hover {
    background: var(--theme-accent);
    color: white;
}

.crm-detail-touchpoints-left {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    transition: all 0.2s ease;
}

.crm-detail-touchpoints-left:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

.crm-detail-touchpoints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    padding-bottom: 4px;
}

.crm-detail-touchpoints-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--theme-accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-detail-touchpoints-header h4 i {
    margin-right: 4px;
}

.crm-add-touchpoint-btn {
    background: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.crm-add-touchpoint-btn:hover {
    background: var(--theme-accent-light);
}

.crm-detail-middle-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.crm-detail-general-info {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.crm-detail-general-info:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

.crm-detail-notes-middle {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    transition: all 0.2s ease;
}

.crm-detail-notes-middle:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

.crm-detail-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    padding-bottom: 4px;
}

.crm-detail-notes-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--theme-accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-detail-notes-header h4 i {
    margin-right: 4px;
}

.crm-add-note-btn {
    background: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.crm-add-note-btn:hover {
    background: var(--theme-accent-light);
}

.crm-detail-right {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    overflow-y: auto;
}

.crm-detail-section-box {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.crm-detail-section-box:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

.crm-detail-section-box h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--theme-accent);
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    padding-bottom: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-detail-section-box h4 i {
    color: var(--theme-accent);
    font-size: 1rem;
}

.section-box-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.crm-dummy-field {
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    break-inside: avoid;
}

.crm-dummy-field .field-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.crm-dummy-field .field-header i {
    color: var(--theme-accent);
    width: 16px;
    font-size: 0.8rem;
}

.crm-dummy-field .field-header .label {
    font-weight: 600;
    color: var(--text-light);
}

.crm-dummy-field .field-value {
    padding-left: 20px;
    color: var(--text-dark);
    word-break: break-word;
}

.crm-detail-touchpoints-left .crm-dummy-field,
.crm-detail-notes-middle .crm-dummy-field {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.crm-detail-touchpoints-left .crm-dummy-field:last-child,
.crm-detail-notes-middle .crm-dummy-field:last-child {
    border-bottom: none;
}

.contact-avatar-square {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    margin-right: 12px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.contact-title-line {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2px;
    display: flex;
    gap: 8px;
}

.social-icons {
    display: flex;
    gap: 16px;
    margin-left: auto;
    align-items: center;
}

.social-icons i {
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.social-icons i:hover {
    transform: scale(1.1);
}

.contact-header-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.contact-name-section {
    flex: 1;
}